summaryrefslogtreecommitdiff
path: root/Command/Sync.hs
Commit message (Collapse)AuthorAge
* 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
|
* direct mode mappings now updated by git annex syncGravatar Joey Hess2012-12-10
| | | | | Still lots to do to make sync handle direct mode, but this is a good first step.
* where indentationGravatar Joey Hess2012-11-12
|
* git config remote.name.annex-sync can be used to control whether a remote ↵Gravatar Joey Hess2012-10-11
| | | | gets synced.
* fix last zombies in the assistantGravatar Joey Hess2012-10-04
| | | | | Made Git.LsFiles return cleanup actions, and everything waits on processes now, except of course for Seek.
* sync: Pushes the git-annex branch to remote/synced/git-annex, rather than ↵Gravatar Joey Hess2012-09-16
| | | | | | | | | | | | | directly to remote/git-annex. This fixes a problem I was seeing in the assistant where two remotes would attempt to sync with one another at the same time, and both failed pushing the diverged git-annex branch. Then when both tried to resolve the failed push, they each modified their git-annex branch, which again each blocked the other from pushing into it. The result was that the git-annex branches were perpetually diverged (despite having the same content!) and once the assistant fell into this trap, it couldn't get out and always had to do the slow push/fail/pull/merge/push/fail cycle.
* add decodeW8Gravatar Joey Hess2012-09-13
|
* refactorGravatar Joey Hess2012-08-26
|
* refactorGravatar Joey Hess2012-08-26
|
* avoid unnecessary transfer scans when syncing a disconnected remoteGravatar Joey Hess2012-08-22
| | | | | | | | | | | | | | | | | | | | Found a very cheap way to determine when a disconnected remote has diverged, and has new content that needs to be transferred: Piggyback on the git-annex branch update, which already checks for divergence. However, this does not check if new content has appeared locally while disconnected, that should be transferred to the remote. Also, this does not handle cases where the two git repos are in sync, but their content syncing has not caught up yet. This code could have its efficiency improved: * When multiple remotes are synced, if any one has diverged, they're all queued for transfer scans. * The transfer scanner could be told whether the remote has new content, the local repo has new content, or both, and could optimise its scan accordingly.
* add routes to pause/start/cancel transfersGravatar Joey Hess2012-08-08
| | | | | | | | | | | | | | | | This commit includes a paydown on technical debt incurred two years ago, when I didn't know that it was bad to make custom Read and Show instances for types. As the routes need Read and Show for Transfer, which includes a Key, and deriving my own Read instance of key was not practical, I had to finally clean that up. So the compact Key read and show functions are now file2key and key2file, and Read and Show are now derived instances. Changed all code that used the old instances, compiler checked. (There were a few places, particularly in Command.Unused, and the test suite where the Show instance continue to be used for legitimate comparisons; ie show key_x == show key_y (though really in a bloom filter))
* handle case of adding populated drive to just created repoGravatar Joey Hess2012-08-05
| | | | | The just created repo has no master branch commits yet. This is now handled, merging in the master branch from the populated drive.
* fix crashes when run in a git repo that has been initted but has no master ↵Gravatar Joey Hess2012-08-05
| | | | branch yet
* Merge branch 'master' into assistantGravatar Joey Hess2012-06-27
|\
| * typoGravatar Joey Hess2012-06-27
| |
* | Merge branch 'master' into assistantGravatar Joey Hess2012-06-27
|\|
| * use "variant" rather than "version"Gravatar Joey Hess2012-06-27
| | | | | | | | | | | | While this word may be less familiar to some users, it avoids the connotation that version 2 is better than version 1, which is wrong when the two variants were conflicting.
| * better filenames for conflict resolution filesGravatar Joey Hess2012-06-27
| |
| * commit merge resolutionGravatar Joey Hess2012-06-27
| | | | | | | | this is necessary so the sync can continue successfully with its push phase
| * fix file nameGravatar Joey Hess2012-06-27
| |
| * don't automerge when the symlinks cannot be parsed as keysGravatar Joey Hess2012-06-27
| |
| * sync: Automatically resolves merge conflicts.Gravatar Joey Hess2012-06-27
| | | | | | | | untested, but it compiles :)
| * properly handle deleted files when processing ls-files --unmergedGravatar Joey Hess2012-06-27
| |
* | Merge branch 'master' into assistantGravatar Joey Hess2012-06-23
|\|
| * sync: Avoid recent git's interactive merge.Gravatar Joey Hess2012-06-23
| |
* | the syncer now pushes out changes to remotes, in parallelGravatar Joey Hess2012-06-22
|/ | | | | | | | | Note that, since this always pushes branch synced/master to the remote, it assumes that master has already gotten all the commits that are on the remote merged in. Otherwise, fast-forward prevention may prevent the push. That's probably ok, because the next stage is to automatically detect incoming pushes and merge.
* sync: Show a nicer message if a user tries to sync to a special remote.Gravatar Joey Hess2012-05-27
|
* added ifM and nuked 11 lines of codeGravatar Joey Hess2012-03-14
| | | | no behavior changes
* sync: Sync to lower cost remotes first.Gravatar Joey Hess2012-03-10
| | | | | | | | | This has two benefits. 1. When a lot of refs are going to be received, get them via lower cost connection when possible. 2. Allows ctrl-c of sync after the cheaper remotes have been pulled from (or pushed to).