summaryrefslogtreecommitdiff
path: root/Command/Sync.hs
Commit message (Collapse)AuthorAge
* sync: Fix committing when in a direct mode repo that has no HEAD ref.Gravatar Joey Hess2015-03-04
| | | | | | | | Seen for example, a newly checked out git submodule. In this case, .git/HEAD is a raw sha, rather than the usual reference to a ref. Removed currentSha in passing, since it was a more roundabout way of doing what headSha does, and headSha is more robust.
* fix innaccurate commentGravatar Joey Hess2015-03-04
|
* sync: As well as the synced/git-annex push, attempt a git-annex:git-annex ↵Gravatar Joey Hess2015-02-27
| | | | | | | | | | | push, as long as the remote branch is an ancestor of the local branch, to better support bare git repos. See my comment in the bug report for analysis; basically this is safe because it's a non-forced push, so won't lose history. Even if it was a forced push or somehow races, things will eventually become consistent and no git-annex branch info will be lost. (This used to be done, but it forgot to do it since version 4.20130909.)
* propigate ssh-options everywhere ssh caching is usedGravatar Joey Hess2015-02-12
| | | | | | | | | * sync: Use the ssh-options git config when doing git pull and push. * remotedaemon: Use the ssh-options git config. Note that the rename env var means that if a new git-annex calls an old one for git-annex ssh, or a new calls an old, nothing much will go wrong; just ssh caching won't happen.
* sync, assistant: Include repository name in head branch commit message.Gravatar Joey Hess2015-02-11
| | | | | | Note that while the assistant detects changes made to remote names, I left the commit message fixed rather than calculating it after every commit. It doesn't seem worth the CPU to do the latter.
* update my email address and homepage urlGravatar Joey Hess2015-01-21
|
* devblogGravatar Joey Hess2015-01-13
|
* handle sync's use of setCurrentDirectory to work with relative pathsGravatar Joey Hess2015-01-06
| | | | | | I think this is the last problimatic setCurrentDirectory. I also audited for extrnal commands that git-annex might run with cwd = foo, and did not find any that were passed any FilePath that might be absolute.
* sync: Fix an edge case where syncing in a bare repository would try to merge ↵Gravatar Joey Hess2015-01-05
| | | | | | | | and so fail. In the case where a remote of the bare repo has a fetch = configuration, refs/remotes/origin/master will exist, and so the merge code path tried to run in the bare repo.
* sync: Now supports remote groups, the same way git remote update does.Gravatar Joey Hess2014-12-29
|
* doh't use "def" for command definitions, it conflicts with Data.Default.defGravatar Joey Hess2014-10-14
|
* fix some mixed space+tab indentationGravatar Joey Hess2014-10-09
| | | | | | | | | This fixes all instances of " \t" in the code base. Most common case seems to be after a "where" line; probably vim copied the two space layout of that line. Done as a background task while listening to episode 2 of the Type Theory podcast.
* sync: Ensure that pending changes to git-annex branch are committed when in ↵Gravatar Joey Hess2014-09-11
| | | | direct mode. (Fixing a very minor reversion.)
* support commit.gpgsignGravatar Joey Hess2014-07-04
| | | | | | | | | | | | | | | | | | | | | Support users who have set commit.gpgsign, by disabling gpg signatures for git-annex branch commits and commits made by the assistant. The thinking here is that a user sets commit.gpgsign intending the commits that they manually initiate to be gpg signed. But not commits made in the background, whether by a deamon or implicitly to the git-annex branch. gpg signing those would be at best a waste of CPU and at worst would fail, or flood the user with gpg passphrase prompts, or put their signature on changes they did not directly do. See Debian bug #753720. Also makes all commits done by git-annex go through a few central control points, to make such changes easier in future. Also disables commit.gpgsign in the test suite. This commit was sponsored by Antoine Boegli.
* assistant: Fix one-way assistant->assistant sync in direct mode.Gravatar Joey Hess2014-06-16
| | | | | | | | | | | | | | When in direct mode, update the master branch after committing to the annex/direct/master branch. Also, update the synced/master branch. This fixes a topology A->B where both A and B are in direct mode and running the assistant, and a change is made to B. Before this fix, A pulled the changes from B, but since they were only on the annex/direct/master branch, it did not merge them. Note that I considered making the assistant merge the remotes/B/annex/direct/master, but decided to keep it simple and only merge the sync branches as before.
* replace (Key, Backend) with KeyGravatar Joey Hess2014-04-17
| | | | | | | | | | Only fsck and reinject and the test suite used the Backend, and they can look it up as needed from the Key. This simplifies the code and also speeds it up. There is a small behavior change here. Before, all commands would warn when acting on an annexed file with an unknown backend. Now, only fsck and reinject show that warning.
* sync, assistant, remotedaemon: Use ssh connection caching for git pushes and ↵Gravatar Joey Hess2014-04-12
| | | | | | | | | | | | | | | | | pulls. For sync, saves 1 ssh connection per remote. For remotedaemon, the same ssh connection that is already open to run git-annex-shell notifychanges is reused to pull from the remote. Only potential problem is that this also enables connection caching when the assistant syncs with a ssh remote. Including the sync it does when a network connection has just come up. In that case, cached ssh connections are likely to be stale, and so using them would hang. Until I'm sure such problems have been dealt with, this commit needs to stay on the remotecontrol branch, and not be merged to master. This commit was sponsored by Alexandre Dupas.
* copy --fast --to remote: Avoid printing anything for files that are already ↵Gravatar Joey Hess2014-03-13
| | | | believed to be present on the remote.
* sync: Automatically resolve merge conflict between and annexed file and a ↵Gravatar Joey Hess2014-03-04
| | | | | | | | | | | | | | | | | | | regular git file. This is a new feature, it was not handled before, since it's a bit of an edge case. However, it can be handled exactly the same as a file/dir conflict, just leave the non-annexed item alone. While implementing this, the core resolveMerge' function got a lot simpler and clearer. Note especially that where before there was an asymetric call to stagefromdirectmergedir, now graftin is called symmetrically in both cases. And, in order to add that `graftin us`, the current branch needed to be known (if there is no current branch, there cannot be a merge conflict). This led to some cleanups of how autoMergeFrom behaved when there is no current branch. This commit was sponsored by Philippe Gauthier.
* factor out Annex.AutoMerge from Command.SyncGravatar Joey Hess2014-03-04
|
* improved direct mode dir/file conflicted merge resultion, using tree graftingGravatar Joey Hess2014-03-04
|
* much improved test and real fix for FAT symlink loss on conflicted mergeGravatar Joey Hess2014-03-04
| | | | | | | | | | | I think that f5ce1a15d7a35b85ffa938ee950f4749bf445939 didn't quite manage to actually fix the bug, although I have not checked since its "fix" got redone. The test suite now actually checks the file staged in git is a symlink, rather than relying on the bug casing a later sync failure. This seems a more reliable way to detect it, and probably avoids a heisenbug in the test suite.
* finish fixing direct mode merge bug involving unstaged local filesGravatar Joey Hess2014-03-04
| | | | | | | | | | Added test cases for both ways this can happen, with a conflict involving a file, or a directory. Cleaned up resolveMerge to not touch the work tree in direct mode, which turned out to be the only way to handle things.. And makes it much nicer. Still need to run test suite on windows.
* rename for clarityGravatar Joey Hess2014-03-03
|
* simplfyGravatar Joey Hess2014-03-03
|
* sync: Fix bug in direct mode that caused a file not checked into git to be ↵Gravatar Joey Hess2014-03-03
| | | | deleted when merging with a remote that added a file by the same name. (Thanks, jkt)
* pre-commit-annex hook script to automatically extract metadata from lots of ↵Gravatar Joey Hess2014-03-02
| | | | | | | | | | | | | | | | | | types of files Using the extract(1) program to do the heavy lifting. Decided to make git-annex run pre-commit-annex when committing. Since git-annex pre-commit also runs it, it'll be run when git commit is run too, via the pre-commit hook. This basically gives back the pre-commit hook that git-annex took away. The implementation avoids repeatedly looking for the hook script when the assistant is running and committing repeatedly; only checks if the hook is available once. To make the script simpler, made git-annex metadata -s field?=value only set a field when it's not already got a value. This commit was sponsored by bak.
* remove Read instance for RefGravatar Joey Hess2014-02-19
| | | | | | | | Removed instance, got it all to build using fromRef. (With a few things that really need to show something using a ref for debugging stubbed out.) Then added back Read instance, and made Logs.View use it for serialization. This changes the view log format.
* hlint to give autobuilder something to doGravatar Joey Hess2014-02-11
|
* add test case & fix conflict resolution bug on Windows & FATGravatar Joey Hess2014-02-04
| | | | | | | | | | | | | | | Fix bug in automatic merge conflict resolution code when used on a filesystem not supporting symlinks, which resulted in it losing track of the symlink bit of annexed files. This was the underlying bug that was causing another test to fail, which got worked around in f5d0c8f0bf7f018479eb4da7e8c41598b7aacb7d. I've chosen to keep 2 separate test cases since the old test case only detected the problem accidentially. Test suite passes on FAT & in windows, as well as on proper unix systems. This commit was sponsored by Ellis Whitehead.
* sync --content: Drop files from remotes that don't have them after getting them.Gravatar Joey Hess2014-02-02
| | | | | | Need to include the uuid of the local repo in the list of belived locations of a key after getting it, in order for the drop from remote to include it in the numcopies calculation.
* update function name in commentGravatar Joey Hess2014-02-02
|
* 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.