Commit graph

200 commits

Author SHA1 Message Date
Joey Hess
959536ef03 fill in a few windows stubs 2013-05-14 16:32:03 -05:00
Joey Hess
306a36260f typo 2013-05-14 15:44:49 -04:00
Joey Hess
7b92ffc3a1 more leaning toothpick fixes 2013-05-14 15:43:23 -04:00
Joey Hess
dc66b1f27d Merge branch 'master' into windows
Conflicts:
	Annex/Environment.hs
	Build/Configure.hs
	Git/Construct.hs
	Utility/FileMode.hs
2013-05-14 15:37:24 -04:00
Joey Hess
81cded2b9d detect local urls on DOS 2013-05-14 15:27:39 -04:00
Joey Hess
03e8594369 fix the day's windows permissions damage 2013-05-12 19:09:48 -04:00
Joey Hess
73d2f8b280 deal with git using / internally, even on DOS 2013-05-12 17:29:49 -05:00
Joey Hess
06551ad86b set raw mode for git check-attr 2013-05-12 16:37:06 -05:00
Joey Hess
abe8d549df fix permission damage (thanks, Windows) 2013-05-11 23:54:25 -04:00
Joey Hess
5e1458152f refactoring 2013-05-11 23:11:56 -04:00
Joey Hess
1e2ddcb68a use setCurrentDirectory
On POSIX, this just calls changeWorkingDirectory.
2013-05-11 19:14:30 -04:00
Joey Hess
18bdff3fae clean up from windows porting 2013-05-11 18:23:41 -04:00
Joey Hess
dc22549ab3 git annex init works on Windows!
git hash-object and cat-file both only use \n at ends of line, even on Windows.
2013-05-11 16:02:35 -05:00
Joey Hess
c45a723876 catFile expects no \r, even on Windows 2013-05-11 15:32:34 -05:00
Joey Hess
3c7e30a295 git-annex now builds on Windows (doesn't work) 2013-05-11 15:03:00 -05:00
Joey Hess
763cbda14f fixup #if 0 stubs to use #ifndef mingw32_HOST_OS
That's needed in files used to build the configure program.
For the other files, I'm keeping my __WINDOWS__ define, as I find that much easier to type.
I may search and replace it to use the mingw32_HOST_OS thing later.
2013-05-10 16:57:21 -05:00
Joey Hess
6c74a42cc6 stub out POSIX stuff 2013-05-10 16:29:59 -05:00
Joey Hess
8a2d1988d3 expose Control.Monad.join
I think I've been looking for that function for some time.
Ie, I remember wanting to collapse Just Nothing to Nothing.
2013-04-22 20:24:53 -04:00
Joey Hess
a5dded0401 assistant: The ConfigMonitor left one zombie behind each time it checked for changes, now fixed. 2013-03-18 22:09:51 -04:00
Joey Hess
2c05c85437 webapp: DTRT when told to create a git repo that already exists. 2013-03-12 08:09:31 -04:00
Joey Hess
ea672b7c77 Bugfix: git annex add, when ran without any file or directory specified, should add files in the current directory, but not act on unlocked files elsewhere in the tree. 2013-03-07 19:03:06 -04:00
Joey Hess
82f639c70f fix type introduced in 0c13d306
Doubled command name broke show-ref, which broke git annex sync.
Re-read all of 0c13d306 to check for other problems.
2013-03-07 11:09:30 -04:00
Joey Hess
0c13d3065e git subcommand cleanup
Pass subcommand as a regular param, which allows passing git parameters
like -c before it. This was already done in the pipeing set of functions,
but not the command running set.
2013-03-03 13:39:07 -04:00
Joey Hess
4d33423067 assistant: Avoid noise in logs from git commit about typechanged files in direct mode repositories. 2013-03-01 16:21:29 -04:00
Joey Hess
8d9c2afd89 Additional GIT_DIR support bugfixes. May actually work now.
Two fixes. First, and most importantly, relax the isLinkToAnnex check
to only look for /annex/objects/, not [^|/].git/annex/objects. If
GIT_DIR is used with a detached work tree, the git directory is
not necessarily named .git.

There are important caveats with doing that at all, since git-annex will
make symlinks that point at GIT_DIR, which means that the relative path
between GIT_DIR and GIT_WORK_TREE needs to remain stable across all clones
of the repository.

----

The other fix is just fixing crazy and wrong code that, when GIT_DIR is
set, expects to still find a git repository in the path below the work
tree, and uses some of its configuration, and some of GIT_DIR. What was I
thinking, and why can't I seem to get this code right?
2013-02-23 12:41:22 -04:00
Joey Hess
52902c0945 make adding modified files work on crippled filesystems 2013-02-20 14:12:55 -04:00
Joey Hess
547d7745fb pre-commit: Update direct mode mappings.
Making the pre-commit hook look at git diff-index to find changed direct
mode files and update the mappings works pretty well.

One case where it does not work is when a file is git annex added, and then
git rmed, and then this is committed. That's a no-op commit, so the hook
probably doesn't even run, and it certianly never notices that the file
was deleted, so the mapping will still have the original filename in it.

For this and other reasons, it's important that the mappings still be
treated as possibly inconsistent.

Also, the assistant now allows the pre-commit hook to run when in direct
mode, so the mappings also get updated there.
2013-02-06 12:44:19 -04:00
Joey Hess
5cd152b8a9 annex.autocommit
New setting, can be used to disable autocommit of changed files by the
assistant, while it still does data syncing and other tasks.

Also wired into webapp UI
2013-01-27 22:43:05 +11:00
Joey Hess
0214e0fb17 union merge bugfix
Union merges involving two or more repositories could sometimes result in
data from one repository getting lost. This could result in the location
log data becoming wrong, and fsck being needed to fix it.

NB: I audited for any other occurrences of this problem. There are other
places than union merge where multiple changes are fed into update-index
in a stream, but they all involve working copy files being staged, or their
deletion being staged, and in this case it's fine for the later changes
to override the earlier ones.
2013-01-16 21:31:06 -04:00
Joey Hess
95db595e91 make startup scan for deleted files work in direct mode
git add --update cannot be used, because it'll stage typechanged direct
mode files. Intead, use ls-files to find deleted files, and stage them
ourselves.

It seems that no commit was made before when the scan staged deleted files.
(Probably masked since if files were added, a commit happened then..)
Now that I'm doing the staging, I was also able to fix that bug.
2012-12-24 14:24:13 -04:00
Joey Hess
92bd889e61 unused 2012-12-18 17:15:11 -04:00
Joey Hess
53dbcce645 direct mode merging works!
Automatic merge resoltion code needs to be fixed to preserve objects from
direct mode files.
2012-12-18 15:04:44 -04:00
Joey Hess
ffdd08fd2e Merge branch 'master' into desymlink 2012-12-13 00:46:10 -04:00
Joey Hess
0d50a6105b whitespace fixes 2012-12-13 00:45:27 -04:00
Joey Hess
b080a58b76 Merge branch 'master' into desymlink
Conflicts:
	Annex/CatFile.hs
	Annex/Content.hs
	Git/LsFiles.hs
	Git/LsTree.hs
2012-12-13 00:29:06 -04:00
Joey Hess
f87a781aa6 finished where indentation changes 2012-12-13 00:24:19 -04:00
Joey Hess
e7b8cb0063 direct mode committing 2012-12-12 19:20:38 -04:00
Joey Hess
b0c5cbfde2 add notStaged 2012-12-12 13:25:26 -04:00
Joey Hess
e8a74e9493 where indentation 2012-12-12 13:20:58 -04:00
Joey Hess
0714b0bd03 remove unused function 2012-12-12 13:17:41 -04:00
Joey Hess
715c67a3e5 git diff-tree interface 2012-12-10 14:36:57 -04:00
Joey Hess
444e984727 don't treat foo::bar as a ssh url
It's a git-remote-helper location, and will be stored as just an url.
2012-11-09 13:50:23 -04:00
Joey Hess
39e82b1af8 webapp: Generate better git remote names.
Wrote a better git remote name sanitizer. Git blows up on lots of weird
stuff, especially if it starts the remote name, but I managed to get
some common punctuation working.
2012-10-31 15:26:19 -04:00
Joey Hess
7ee0ffaeb9 Use USER and HOME environment when set, and only fall back to getpwent, which doesn't work with LDAP or NIS. 2012-10-25 18:17:54 -04:00
Joey Hess
c7c2015435 add ConfigMonitor thread
Monitors git-annex branch for changes, which are noticed by the Merger
thread whenever the branch ref is changed (either due to an incoming push,
or a local change), and refreshes cached config values for modified config
files.

Rate limited to run no more often than once per minute. This is important
because frequent git-annex branch changes happen when files are being
added, or transferred, etc.

A primary use case is that, when preferred content changes are made,
and get pushed to remotes, the remotes start honoring those settings.
Other use cases include propigating repository description and trust
changes to remotes, and learning when a remote has added a new special
remote, so the webapp can present the GUI to enable that special remote
locally.

Also added a uuid.log cache. All other config files already had caches.
2012-10-20 16:43:35 -04:00
Joey Hess
b281584422 remove some more !! 2012-10-20 16:21:43 -04:00
Joey Hess
e6b1f36e1d Fix handling of GIT_DIR when it refers to a git submodule.
The old code was just wrong in taking fromPath of GIT_DIR -- that made an
localUnknown location with the GIT_DIR in it, which only worked by
accident, and failed in submodules.
2012-10-17 14:28:05 -04:00
Joey Hess
919fec85cd better fix for zombie problem, which turns out to be a zombie ssh started by rsync
When rsyncProgress pipes rsync's stdout, this turns out to cause a ssh
process started by rsync to be left behind as a zombie. I don't know why,
but my recent zombie reaping cleanup was correct, it's just that this other
zombie, that's not directly started by git-annex, was no longer reaped
due to changes in the cleanup. Make rsyncProgress reap the zombie started
by rsync, as a workaround.

FWIW, the process tree looks like this. It seems like the rsync child
is for some reason starting but not waiting on this extra ssh process.
Ssh connection caching may be involved -- disabling it seemed to change
the shape of the tree, but did not eliminate the zombie.

 9378 pts/14   S+     0:00  |           \_ rsync -p --progress --inplace -4 -e 'ssh' '-S' ...
 9379 pts/14   S+     0:00  |           |   \_ ssh ...
 9380 pts/14   S+     0:00  |           |   \_ rsync -p --progress --inplace -4 -e 'ssh' '-S' ...
 9381 pts/14   Z+     0:00  |           \_ [ssh] <defunct>
2012-10-17 00:47:52 -04:00
Joey Hess
4f95cc8ef1 ensure that gitdir is absolute
calcGitLink turns out to need it to be absolute, and it normally is,
but not if it's read from a .git file in a submodule, or perhaps from
GIT_DIR.

I should look into dropping this invariant.
2012-10-16 16:25:45 -04:00
Joey Hess
8fec62d299 A relative core.worktree is relative to the gitdir.
Now that this is handled correctly, git-annex can be used in git submodules.

Also, fixed infelicity where Git.CurrentRepo and Git.Config.updateLocation
were both dealing with core.worktree. Now updateLocation handles it for
Local as well as for LocalUnknown repos.
2012-10-16 00:08:39 -04:00