summaryrefslogtreecommitdiff
path: root/Command/Sync.hs
Commit message (Collapse)AuthorAge
...
* sync --content: Reuse smart copy code from copy command, including handling ↵Gravatar Joey Hess2014-02-02
| | | | and repairing out of date location tracking info. Closes: #737480
* remove some monkey facesGravatar Joey Hess2014-02-01
|
* sync --content: Re-pull from remotes after downloading content, since that ↵Gravatar Joey Hess2014-02-01
| | | | can take a while and other changes may be pushed in the meantime.
* improve sync with xmpp and annex-ignoreGravatar Joey Hess2014-02-01
| | | | | | * sync --content: Honor annex-ignore configuration. * sync: Don't try to sync with xmpp remotes, which are only currently supported when using the assistant.
* avoid using function named that conflicts with name used in newer version of ↵Gravatar Joey Hess2014-01-29
| | | | process library
* reorganize some files and importsGravatar Joey Hess2014-01-26
|
* fix transfers of key with no associated fileGravatar Joey Hess2014-01-23
| | | | | | | | | | | | | | | | | Several places assumed this would not happen, and when the AssociatedFile was Nothing, did nothing. As part of this, preferred content checks pass the Key around. Note that checkMatcher is sometimes now called with Just Key and Just File. It currently constructs a FileMatcher, ignoring the Key. However, if it constructed a FileKeyMatcher, which contained both, then it might be possible to speed up parts of Limit, which currently call the somewhat expensive lookupFileKey to get the Key. I have not made this optimisation yet, because I am not sure if the key is always the same. Will need some significant checking to satisfy myself that's the case..
* much better command action handling for sync --contentGravatar Joey Hess2014-01-20
|
* fix inversion of control in CommandSeek (no behavior changes)Gravatar Joey Hess2014-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've been disliking how the command seek actions were written for some time, with their inversion of control and ugly workarounds. The last straw to fix it was sync --content, which didn't fit the Annex [CommandStart] interface well at all. I have not yet made it take advantage of the changed interface though. The crucial change, and probably why I didn't do it this way from the beginning, is to make each CommandStart action be run with exceptions caught, and if it fails, increment a failure counter in annex state. So I finally remove the very first code I wrote for git-annex, which was before I had exception handling in the Annex monad, and so ran outside that monad, passing state explicitly as it ran each CommandStart action. This was a real slog from 1 to 5 am. Test suite passes. Memory usage is lower than before, sometimes by a couple of megabytes, and remains constant, even when running in a large repo, and even when repeatedly failing and incrementing the error counter. So no accidental laziness space leaks. Wall clock speed is identical, even in large repos. This commit was sponsored by an anonymous bitcoiner.
* include information about remotes just uloaded to when calling handleDropsFromGravatar Joey Hess2014-01-19
|
* sync --content: New option that makes the content of annexed files be ↵Gravatar Joey Hess2014-01-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | transferred. Similar to the assistant, this honors any configured preferred content expressions. I am not entirely happpy with the implementation. It would be nicer if the seek function returned a list of actions which included the individual file gets and copies and drops, rather than the current list of calls to syncContent. This would allow getting rid of the somewhat reundant display of "sync file [ok|failed]" after the get/put display. But, do that, withFilesInGit would need to somehow be able to construct such a mixed action list. And it would be less efficient than the current implementation, which is able to reuse several values between eg get and drop. Note that currently this does not try to satisfy numcopies when getting/putting files (numcopies are of course checked when dropping files!) This makes it like the assistant, and unlike get --auto and copy --auto, which do duplicate files when numcopies is not yet satisfied. I don't know if this is the right decision; it only seemed to make sense to have this parallel the assistant as far as possible to start with, since I know the assistant works. This commit was sponsored by Øyvind Andersen Holm.
* Remotes can now be made read-only, by setting remote.<name>.annex-readonlyGravatar Joey Hess2014-01-02
|
* Avoid using git commit in direct mode, since in some situations it will read ↵Gravatar Joey Hess2013-12-01
| | | | | | | | | | | | the full contents of files in the tree. The assistant's commit code also always avoids git commit, for simplicity. Indirect mode sync still does a git commit -a to catch unstaged changes. Note that this means that direct mode sync no longer runs the pre-commit hook or any other hooks git commit might call. The git annex pre-commit hook action for direct mode is however explicitly run. (The assistant already ran git commit with hooks disabled, so no change there.)
* on second thought, don't change sync to exit nonzero on successful ↵Gravatar Joey Hess2013-11-14
| | | | | | conflicted merge resolution For one thing, that breaks the test suite. May revisit later.
* add a note after successful conflicted merge resolutionGravatar Joey Hess2013-11-14
|
* sync: When there are merge conflicts that get automatically resolved, exit ↵Gravatar Joey Hess2013-11-07
| | | | nonzero at the end.
* work around lack of receive.denyCurrentBranch in direct modeGravatar Joey Hess2013-11-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now that direct mode sets core.bare=true, git's normal prohibition about pushing into the currently checked out branch doesn't work. A simple fix for this would be an update hook which blocks the pushes.. but git hooks must be executable, and git-annex needs to be usable on eg, FAT, which lacks x bits. Instead, enabling direct mode switches the branch (eg master) to a special purpose branch (eg annex/direct/master). This branch is not pushed when syncing; instead any changes that git annex sync commits get written to master, and it's pushed (along with synced/master) to the remote. Note that initialization has been changed to always call setDirect, even if it's just setDirect False for indirect mode. This is needed because if the user has just cloned a direct mode repo, that nothing has synced with before, it may have no master branch, and only a annex/direct/master. Resulting in that branch being checked out locally too. Calling setDirect False for indirect mode moves back out of this branch, to a new master branch, and ensures that a manual "git push" doesn't push changes directly to the annex/direct/master of the remote. (It's possible that the user makes a commit w/o using git-annex and pushes it, but nothing I can do about that really.) This commit was sponsored by Jonathan Harrington.
* sync: Work even when the local git repository is new and empty, with no ↵Gravatar Joey Hess2013-11-02
| | | | master branch.
* use a long note hereGravatar Joey Hess2013-11-01
|
* sync: print a hint about receive.denyNonFastForwards when a push failsGravatar Joey Hess2013-10-26
|
* sync: fix crash on first sync when no branch exists yetGravatar Joey Hess2013-10-17
|
* fix indirect mode conflict merge when only one side is annexed fileGravatar Joey Hess2013-10-16
| | | | | git-merge's creation of file~HEAD type files did not make this especially nice to do.
* sync: Fix automatic resolution of merge conflicts where one side is an ↵Gravatar Joey Hess2013-10-16
| | | | | | | | | annexed file, and the other side is a non-annexed file, or a directory. Note that this case is only fully automatically resolved in direct mode. In indirect mode, git merge moves the file to file~HEAD, and replaces it with the directory, and leaves the file in unmerged state, and sync doesn't yet change that.
* hlintGravatar Joey Hess2013-09-25
| | | | test suite still passes
* more completely solve catKey memory leakGravatar Joey Hess2013-09-19
| | | | | | | | | | | | | | | | | | | Done using a mode witness, which ensures it's fixed everywhere. Fixing catFileKey was a bear, because git cat-file does not provide a nice way to query for the mode of a file and there is no other efficient way to do it. Oh, for libgit2.. Note that I am looking at tree objects from HEAD, rather than the index. Because I cat-file cannot show a tree object for the index. So this fix is technically incomplete. The only cases where it matters are: 1. A new large file has been directly staged in git, but not committed. 2. A file that was committed to HEAD as a symlink has been staged directly in the index. This could be fixed a lot better using libgit2.
* sync: Don't fail if the directory it is run in gets removed by the sync.Gravatar Joey Hess2013-09-13
|
* sync: support gcrypt4.20130909Gravatar Joey Hess2013-09-09
|
* sync, assistant: Force push of the git-annex branch.Gravatar Joey Hess2013-08-29
| | | | | Necessary to ensure it gets pushed to remotes after being rewritten by forget. See inline rationalles for why I think this is safe!
* sync, merge: Bug fix: Don't try to merge into master when in a bare repo.Gravatar Joey Hess2013-08-17
|
* sync: Better support for bare git remotes. Now pushes directly to the master ↵Gravatar Joey Hess2013-06-12
| | | | branch on such a remote, instead of to synced/master. This makes it easier to clone from a bare git remote that has been populated with git annex sync or by the assistant.
* fix merge conflict resolution when both sides have the same keyGravatar Joey Hess2013-05-26
| | | | Still need to git rm the old file so git accepts the merge is resolved.
* correct recent fixGravatar Joey Hess2013-05-26
| | | | | 588a981e17461643b67f9a372703b9e0896b6e17's fix caused it to try to stage a symlink in .git/annex/tmp, oops
* sync: Fix double merge conflict resolution handling.Gravatar Joey Hess2013-05-26
| | | | | | | Ie, when there'a a conflicted merge we may get foo.variant-xxxx created in a merge. If a second merge conflict occurs on that new file, it was not falling back to putting in the whole key (which should stop the merge conflicts happening for good, but is ugly).
* fuzz test discovered a way automatic merge resultion can fail; fixGravatar Joey Hess2013-05-25
| | | | | It may be that the directory we need to make a symlink in, to resolve the merge, doesn't exist locally.
* sync: Commit in direct mode even if no changes were stagedGravatar Joey Hess2013-04-23
| | | | | | | | There may be already staged changes from a prior `git annex add`, so always commit. Also, suppressed the commit output, since it contains noise due to typechanged files in direct mode.
* sync, assistant: Sync with remotes that have annex-ignore setGravatar Joey Hess2013-04-22
| | | | | | | | This is so git remotes on servers without git-annex installed can be used to keep clients' git repos in sync. This is a behavior change, but since annex-sync can be set to disable syncing with a remote, I think it's acceptable.
* Use lower case hash directories for storing files on crippled filesystems, ↵Gravatar Joey Hess2013-04-04
| | | | | | | | | | | | | | | same as is already done for bare repositories. * since this is a crippled filesystem anyway, git-annex doesn't use symlinks on it * so there's no reason to use the mixed case hash directories that we're stuck using to avoid breaking everyone's symlinks to the content * so we can do what is already done for all bare repos, and make non-bare repos on crippled filesystems use the all-lower case hash directories * which are, happily, all 3 letters long, so they cannot conflict with mixed case hash directories * so I was able to 100% fix this and even resuming `git annex add` in the test case will recover and it will all just work.
* add section metadata to all commandsGravatar Joey Hess2013-03-24
| | | | Not yet used .. mindless train work.
* git subcommand cleanupGravatar Joey Hess2013-03-03
| | | | | | 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.
* fully support core.symlinks=false in all relevant symlink handling codeGravatar Joey Hess2013-02-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactored annex link code into nice clean new library. Audited and dealt with calls to createSymbolicLink. Remaining calls are all safe, because: Annex/Link.hs: ( liftIO $ createSymbolicLink linktarget file only when core.symlinks=true Assistant/WebApp/Configurators/Local.hs: createSymbolicLink link link test if symlinks can be made Command/Fix.hs: liftIO $ createSymbolicLink link file command only works in indirect mode Command/FromKey.hs: liftIO $ createSymbolicLink link file command only works in indirect mode Command/Indirect.hs: liftIO $ createSymbolicLink l f refuses to run if core.symlinks=false Init.hs: createSymbolicLink f f2 test if symlinks can be made Remote/Directory.hs: go [file] = catchBoolIO $ createSymbolicLink file f >> return True fast key linking; catches failure to make symlink and falls back to copy Remote/Git.hs: liftIO $ catchBoolIO $ createSymbolicLink loc file >> return True ditto Upgrade/V1.hs: liftIO $ createSymbolicLink link f v1 repos could not be on a filesystem w/o symlinks Audited and dealt with calls to readSymbolicLink. Remaining calls are all safe, because: Annex/Link.hs: ( liftIO $ catchMaybeIO $ readSymbolicLink file only when core.symlinks=true Assistant/Threads/Watcher.hs: ifM ((==) (Just link) <$> liftIO (catchMaybeIO $ readSymbolicLink file)) code that fixes real symlinks when inotify sees them It's ok to not fix psdueo-symlinks. Assistant/Threads/Watcher.hs: mlink <- liftIO (catchMaybeIO $ readSymbolicLink file) ditto Command/Fix.hs: stopUnless ((/=) (Just link) <$> liftIO (catchMaybeIO $ readSymbolicLink file)) $ do command only works in indirect mode Upgrade/V1.hs: getsymlink = takeFileName <$> readSymbolicLink file v1 repos could not be on a filesystem w/o symlinks Audited and dealt with calls to isSymbolicLink. (Typically used with getSymbolicLinkStatus, but that is just used because getFileStatus is not as robust; it also works on pseudolinks.) Remaining calls are all safe, because: Assistant/Threads/SanityChecker.hs: | isSymbolicLink s -> addsymlink file ms only handles staging of symlinks that were somehow not staged (might need to be updated to support pseudolinks, but this is only a belt-and-suspenders check anyway, and I've never seen the code run) Command/Add.hs: if isSymbolicLink s || not (isRegularFile s) avoids adding symlinks to the annex, so not relevant Command/Indirect.hs: | isSymbolicLink s -> void $ flip whenAnnexed f $ only allowed on systems that support symlinks Command/Indirect.hs: whenM (liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus f) $ do ditto Seek.hs:notSymlink f = liftIO $ not . isSymbolicLink <$> getSymbolicLinkStatus f used to find unlocked files, only relevant in indirect mode Utility/FSEvents.hs: | Files.isSymbolicLink s = runhook addSymlinkHook $ Just s Utility/FSEvents.hs: | Files.isSymbolicLink s -> Utility/INotify.hs: | Files.isSymbolicLink s -> Utility/INotify.hs: checkfiletype Files.isSymbolicLink addSymlinkHook f Utility/Kqueue.hs: | Files.isSymbolicLink s = callhook addSymlinkHook (Just s) change all above are lower-level, not relevant Audited and dealt with calls to isSymLink. Remaining calls are all safe, because: Annex/Direct.hs: | isSymLink (getmode item) = This is looking at git diff-tree objects, not files on disk Command/Unused.hs: | isSymLink (LsTree.mode l) = do This is looking at git ls-tree, not file on disk Utility/FileMode.hs:isSymLink :: FileMode -> Bool Utility/FileMode.hs:isSymLink = checkMode symbolicLinkMode low-level Done!!
* avoid queueing rm of no filesGravatar Joey Hess2013-02-05
|
* sync: Automatic merge conflict resolution now stages deleted files.Gravatar Joey Hess2013-01-17
|
* type based git config handling for remotesGravatar Joey Hess2013-01-01
| | | | | Still a couple of places that use git config ad-hoc, but this is most of it done.
* use sync command merge engine in assistantGravatar Joey Hess2012-12-25
| | | | To handle direct mode merging.
* more quickcheck funGravatar Joey Hess2012-12-19
|
* partial and incomplete automatic merging in direct modeGravatar Joey Hess2012-12-18
| | | | Handles our file right, but not theirs.
* direct mode merging works!Gravatar Joey Hess2012-12-18
| | | | | Automatic merge resoltion code needs to be fixed to preserve objects from direct mode files.
* reorder for better displayGravatar Joey Hess2012-12-13
|
* direct mode committingGravatar Joey Hess2012-12-12
|
* also update direct mode associated files in local mergeGravatar Joey Hess2012-12-12
|