aboutsummaryrefslogtreecommitdiff
path: root/Assistant/Sync.hs
Commit message (Collapse)AuthorAge
* assistant: update export db after mergeing git-annex branch changesGravatar Joey Hess2017-09-20
| | | | | | | | Needed so that the assistant can download from exports. updateExportTreeFromLog is normally only run one time, but needs to be run repeatedly during the lifetime of the assistant. This commit was sponsored by Ethan Aubin on Patreon.
* add exporter thread to assistantGravatar Joey Hess2017-09-20
| | | | | | | | | | | | | | | | | | | | | | | This is similar to the pusher thread, but a separate thread because git pushes can be done in parallel with exports, and updating a big export should not prevent other git pushes going out in the meantime. The exportThread only runs at most every 30 seconds, since updating an export is more expensive than pushing. This may need to be tuned. Added a separate channel for export commits; the committer records a commit in that channel. Also, reconnectRemotes records a dummy commit, to make the exporter thread wake up and make sure all exports are up-to-date. So, connecting a drive with a directory special remote export will immediately update it, and getting online will automatically update S3 and WebDAV exports. The transfer queue is not involved in exports. Instead, failed exports are retried much like failed pushes. This commit was sponsored by Ewen McNeill.
* add annex-ignore-command and annex-sync-command configsGravatar Joey Hess2017-08-17
| | | | | | | | | | | | | | | | Added remote configuration settings annex-ignore-command and annex-sync-command, which are dynamic equivilants of the annex-ignore and annex-sync configurations. For this I needed a new DynamicConfig infrastructure. Its implementation should be as fast as before when there is no dynamic config, and it caches so shell commands are only run once. Note that annex-ignore-command exits nonzero when the remote should be ignored. While that may seem backwards, it allows using the same command for it as for annex-sync-command when you want to disable both. This commit was sponsored by Trenton Cronholm on Patreon.
* configuration to disable automatic merge conflict resolutionGravatar Joey Hess2017-06-01
| | | | | | | | | | | | | | | * Added annex.resolvemerge configuration, which can be set to false to disable the usual automatic merge conflict resolution done by git-annex sync and the assistant. * sync: Added --no-resolvemerge option. Note that disabling merge conflict resolution is probably not a good idea in a direct mode repo or adjusted branch. Since updates to both are done outside the usual work tree, if it fails the tree is not left in a conflicted state, and it would be hard to manually resolve the conflict. Still, made annex.resolvemerge be supported in those cases for consistency. This commit was sponsored by Riku Voipio.
* Added remote.<name>.annex-push and remote.<name>.annex-pullGravatar Joey Hess2017-04-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The former can be useful to make remotes that don't get fully synced with local changes, which comes up in a lot of situations. The latter was mostly added for symmetry, but could be useful (though less likely to be). Implementing `remote.<name>.annex-pull` was a bit tricky, as there's no one place where git-annex pulls/fetches from remotes. I audited all instances of "fetch" and "pull". A few cases were left not checking this config: * Git.Repair can try to pull missing refs from a remote, and if the local repo is corrupted, that seems a reasonable thing to do even though the config would normally prevent it. * Assistant.WebApp.Gpg and Remote.Gcrypt and Remote.Git do fetches as part of the setup process of a remote. The config would probably not be set then, and having the setup fail seems worse than honoring it if it is already set. I have not prevented all the code that does a "merge" from merging branches from remotes with remote.<name>.annex-pull=false. That could perhaps be done, but it would need a way to map from branch name to remote name, and the way refspecs work makes that hard to get really correct. So if the user fetches manually, the git-annex branch will get merged, for example. Anther way of looking at/justifying this is that the setting is called "annex-pull", not "annex-merge". This commit was supported by the NSF-funded DataLad project.
* mocked up wormhole pairing interface in webappGravatar Joey Hess2016-12-24
|
* Merge branch 'master' into no-xmppGravatar Joey Hess2016-12-24
|\
| * sync: Pass --allow-unrelated-histories to git merge when used with git git ↵Gravatar Joey Hess2016-11-15
| | | | | | | | | | | | | | | | | | | | | | | | 2.9.0 or newer. This makes merging a remote into a freshly created direct mode repository work the same as it works in indirect mode. The git-annex branches would get merged in any case by a sync, since that doesn't use git merge. This might need to be revisited later to better mirror git's behavior.
* | remove xmpp supportGravatar Joey Hess2016-11-14
|/ | | | | | | | | | | | I've long considered the XMPP support in git-annex a wart. It's nice to remove it. (This also removes the NetMessager, which was only used for XMPP, and the daemonstatus's desynced list (likewise).) Existing XMPP remotes should be ignored by git-annex. This commit was sponsored by Brock Spratlen on Patreon.
* get, move, copy, mirror: Added --failed switch which retries failed copies/movesGravatar Joey Hess2016-08-03
| | | | | | | | | Note that get --from foo --failed will get things that a previous get --from bar tried and failed to get, etc. I considered making --failed only retry transfers from the same remote, but it was easier, and seems more useful, to not have the same remote requirement. Noisy due to some refactoring into Types/
* assistant: Deal with upcoming git's refusal to merge unrelated histories by ↵Gravatar Joey Hess2016-04-22
| | | | | | | | | | | | | default git 2.8.1 (or perhaps 2.9.0) is going to prevent git merge from merging in unrelated branches. Since the webapp's pairing etc features often combine together repositories with unrelated histories, work around this behavior change by setting GIT_MERGE_ALLOW_UNRELATED_HISTORIES when the assistant merges. Note though that this is not done for git annex sync's merges, so it will follow git's default or configured behavior.
* make sync aware of adjusted branchesGravatar Joey Hess2016-02-29
| | | | | | | | | | So, it will pull and push the original branch, not the adjusted one. And, for merging, it will use updateAdjustedBranch (not implemented yet). Note that remaining uses of Git.Branch.current need to be checked too; for things that should act on the original branch, and not the adjusted branch.
* assistant: Pass ssh-options through 3 more git pull/push calls that were ↵Gravatar Joey Hess2015-11-10
| | | | | | | missed before. It was used for regular pull, but not for regular push, tagged push, or the fallback fetching.
* update my email address and homepage urlGravatar Joey Hess2015-01-21
|
* 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.
* assistant: Now detects immediately when other repositories push changes toGravatar Joey Hess2014-04-08
| | | | | | | | | | | | a ssh remote, and pulls. XMPP is no longer needed in this configuration! Requires the remote server have git-annex-shell with notifychanges support. (untested) This commit was sponsored by Geog Wechslberger.
* 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.
* Remotes can now be made read-only, by setting remote.<name>.annex-readonlyGravatar Joey Hess2014-01-02
|
* add post-repair actionsGravatar Joey Hess2013-10-29
|
* move code around and rename thread; no functional changesGravatar Joey Hess2013-10-29
|
* automatically launch git repository repairGravatar Joey Hess2013-10-27
| | | | | | | | | | | | | | | | | | Added a RemoteChecker thread, that waits for problems to be reported with remotes, and checks if their git repository is in need of repair. Currently, only failures to sync with the remote cause a problem to be reported. This seems enough, but we'll see. Plugging in a removable drive with a repository on it that is corrupted does automatically repair the repository, as long as the corruption causes git push or git pull to fail. Some types of corruption do not, eg missing/corrupt objects for blobs that git push doesn't need to look at. So, this is not really a replacement for scheduled git repository fscking. But it does make the assistant more robust. This commit is sponsored by Fernando Jimenez.
* moved code out of webappGravatar Joey Hess2013-10-26
| | | | | No code changes, aside from some changes to lifting in code that turned out to be able to run in Assistant rather than Handler.
* only sync with local repos that are currently available (and only fsck them too)Gravatar Joey Hess2013-10-14
|
* cronner: run jobs triggered by remotes becoming connected (untested)Gravatar Joey Hess2013-10-13
|
* include HEAD in CanPush shasGravatar Joey Hess2013-05-21
|
* XMPP: Avoid redundant and unncessary pushes. Note that this breaks ↵Gravatar Joey Hess2013-05-21
| | | | compatibility with previous versions of git-annex, which will refuse to accept any XMPP pushes from this version.
* add uuid to all xmpp messagesGravatar Joey Hess2013-04-30
| | | | | | | | | | | | | | | | | | (Except for the actual streaming of receive-pack through XMPP, which can only run once we've gotten an appropriate uuid in a push initiation message.) Pushes are now only initiated when the initiation message comes from a known uuid. This allows multiple distinct repositories to use the same xmpp address. Note: This probably breaks initial push after xmpp pairing, because at that point we may not know about the paired uuid, and so reject the push from it. It won't break in simple cases, because the annex-uuid of the remote is checked. However, when there are multiple clients behind a single xmpp address, only uuid of the first is recorded in annex-uuid, and so any pushes from the others will be rejected (unless the first remote pushes their uuids to us beforehand.
* 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.
* syncNewRemote is not only used for new remotes; rename to syncRemoteGravatar Joey Hess2013-04-08
|
* refactor alert button creation codeGravatar Joey Hess2013-04-04
|
* avoid showing web special remote in sync alertGravatar Joey Hess2013-03-28
|
* avoid displaying alert when syncing only to removable drives and all not ↵Gravatar Joey Hess2013-03-27
| | | | attached
* fix inverted logic in filtering failed remotesGravatar Joey Hess2013-03-27
|
* don't show sync failure for drive that's not plugged inGravatar Joey Hess2013-03-18
|
* webapp: Improved alerts displayed when syncing with remotes, and when ↵Gravatar Joey Hess2013-03-18
| | | | syncing with a remote fails.
* unify two similar alertsGravatar Joey Hess2013-03-18
|
* avoid false alert about syncing with xmpp remoteGravatar Joey Hess2013-03-06
|
* avoid too early scanning for xmppremotesGravatar Joey Hess2013-03-06
|
* tag xmpp pushes with jidGravatar Joey Hess2013-03-06
| | | | | | | | | | This fixes the issue mentioned in the last commit. Turns out just collecting UUID of clients behind a XMPP remote is insufficient (although I should probably still do it for other reasons), because a single remote repo might be connected via both XMPP and local pairing. So a way is needed to know when a push was received from any client using a given XMPP remote over XMPP, as opposed to via ssh.
* assistant: Get back in sync with XMPP remotes after network reconnection, ↵Gravatar Joey Hess2013-03-06
| | | | | | | | | | | | | | | | | | | | | and on startup. Make manualPull send push requests over XMPP. When reconnecting with remotes, those that are XMPP remotes cannot immediately be pulled from and scanned, so instead maintain a set of (probably) desynced remotes, and put XMPP remotes on it. (This set could be used in other ways later, if we can detect we're out of sync with other types of remotes.) The merger handles detecting when a XMPP push is received from a desynced remote, and triggers a scan then, if they have in fact diverged. This has one known bug: A single XMPP remote can have multiple clients behind it. When this happens, only the UUID of one client is recorded as the UUID of the XMPP remote. Pushes from the other XMPP clients will not trigger a scan. If the client whose UUID is expected responds to the push request, it'll work, but when that client is offline, we're SOL.
* 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.
* assistant: Fix syncing to just created ssh remotes.Gravatar Joey Hess2012-12-06
| | | | | This got broken when I optimised reconnecting with remotes, to not do a full scan if the remote was not diverged.
* show when a buddy is already pairedGravatar Joey Hess2012-11-10
|
* avoid sending xmpp push notifications when not pushing to any remotesGravatar Joey Hess2012-11-10
|
* full-on git-annex assistant syncing now works over XMPP!Gravatar Joey Hess2012-11-10
| | | | | | | | | | I decided to use the fallback push mode from the beginning for XMPP, since while it uses some ugly branches, it avoids the possibility of a normal push failing, and needing to pull and re-push. Due to the overhead of XMPP, and the difficulty of building such a chain of actions due to the async implementation, this seemed reasonable. It seems to work great!
* separate data type for push stagesGravatar Joey Hess2012-11-10
| | | | This improves type safety.
* add canpush xmpp commandGravatar Joey Hess2012-11-09
|
* blog for the dayGravatar Joey Hess2012-11-08
|
* refactor XMPP clientGravatar Joey Hess2012-11-03
|
* where indentationGravatar Joey Hess2012-10-31
|