summaryrefslogtreecommitdiff
path: root/Assistant/Threads/Merger.hs
Commit message (Collapse)AuthorAge
* refactor getCurrentBranchJoey Hess2018-10-19
| | | | | | | | | | | Both Command.Sync and Annex.Ingest had their own versions of this. The one in Annex.Ingest used Git.Branch.currentUnsafe, but does not seem to need it. That is only checking to see if it's in an adjusted unlocked branch, and when in an adjusted branch, the branch does in fact exist, so the added check that Git.Branch.current does is fine. This commit was sponsored by Denis Dzyubenko on Patreon.
* assistant: update export db after mergeing git-annex branch changesJoey 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.
* assistant: Merge changes from refs/remotes/foo/master into master.Joey Hess2017-06-07
| | | | | | | | | | | | | | | | Previously, only sync branches were merged. This makes regular git push into a repository watched by the assistant auto-merge. While this does hardcode an assumption about what the remote tracking branch is named, which some unusual git configurations won't match, git-annex sync already made the same assumption. Also, changed behavior when a tracking branch like refs/remotes/synced/not/master is received. When on the master branch, that used to get merged into it, but it's the tracking branch for not/master, so should only be merged in when on the not/master branch. This commit was sponsored by Ewen McNeill.
* analysisJoey Hess2017-06-07
| | | | | Also, added a comment to Assistant/Threads/Merger.hs to explain why it only merges from /synced/ branches.
* configuration to disable automatic merge conflict resolutionJoey 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.
* clean up some importsJoey Hess2016-12-27
|
* Merge branch 'master' into no-xmppJoey Hess2016-12-24
|\
| * sync: Pass --allow-unrelated-histories to git merge when used with git git ↵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 supportJoey 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.
* move keys db closure to AutoMergeJoey Hess2016-05-16
| | | | | This makes git-annex sync also do it, which makes sure that the keys db info is fresh when doing a sync --content.
* assistant: Fix race in v6 mode that caused downloaded file content to ↵Joey Hess2016-05-16
| | | | | | | | | | | | sometimes not replace pointer files. The keys database handle needs to be closed after merging, because the smudge filter, in another process, updates the database. Old cached info can be read for a while from the open database handle; closing it ensures that the info written by the smudge filter is available. This is pretty horribly ad-hoc, and it's especially nasty that the transferrer closes the database every time.
* assistant: Deal with upcoming git's refusal to merge unrelated histories by ↵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 assistant aware of adjusted branches when mergingJoey Hess2016-02-29
|
* update my email address and homepage urlJoey Hess2015-01-21
|
* Really fix bug that caused the assistant to make many unncessary empty merge ↵Joey Hess2014-07-09
| | | | commits.
* assistant: Fix bug, introduced in last release, that caused the assistant to ↵Joey Hess2014-07-05
| | | | make many unncessary empty merge commits.
* support commit.gpgsignJoey 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.
* annex.startupscan can be set to false to disable the assistant's startup scan.Joey Hess2014-03-05
|
* sync: Automatically resolve merge conflict between and annexed file and a ↵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.SyncJoey Hess2014-03-04
|
* remove Read instance for RefJoey 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.
* hlintJoey Hess2013-10-02
|
* assistant: Fix bug that could cause incoming pushes to not get merged into ↵Joey Hess2013-04-30
| | | | | | | | | | the local tree. Observed that the pushed refs were received, but not merged into master. The merger never saw an add event for these refs. Either git is not writing to a new file and renaming it into place, or the inotify code didn't notice that. Changed it to also watch for modify events and that seems to have fixed it!
* let's put type modules under the parent module, not in a Types directoryJoey Hess2013-03-10
|
* tag xmpp pushes with jidJoey 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, ↵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.
* add additional debug info about reasons for transfersJoey Hess2013-03-01
|
* webapp: Now allows restarting any threads that crash.Joey Hess2013-01-26
|
* use sync command merge engine in assistantJoey Hess2012-12-25
| | | | To handle direct mode merging.
* where indentationJoey Hess2012-10-31
|
* finished pushing Assistant monad into all relevant filesJoey Hess2012-10-30
| | | | All temporary and old functions are removed.
* split BranchChange and liftedJoey Hess2012-10-29
|
* converted 6 more threadsJoey Hess2012-10-29
|
* Assistant monad, stage 2.5Joey Hess2012-10-29
| | | | | | | | | | Converted several threads to run in the monad. Added a lot of useful combinators for working with the monad. Now the monad includes the name of the thread. Some debugging messages are disabled pending converting other threads.
* add ConfigMonitor threadJoey Hess2012-10-20
| | | | | | | | | | | | | | | | | | | | 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.
* use gitRepoJoey Hess2012-10-12
|
* run current branch merge in annex monadJoey Hess2012-09-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I was seeing some interesting crashes after the previous commit, when making file changes slightly faster than the assistant could keep up. error: Ref refs/heads/master is at 7074f8e0a11110c532d06746e334f2fec6af6ab4 but expected 95ea86008d72a40d97a81cfc8fb47a0da92166bd fatal: cannot lock HEAD ref Committer crashed: git commit [Param "--allow-empty-message",Param "-m",Param "",Param "--allow-empty",Param "--quiet"] failed Pusher crashed: thread blocked indefinitely in an STM transaction Clearly the the merger ended up running at the same time as the committer, and with both modifying HEAD the committer crashed. I fixed that by making the Merger run its merge inside the annex monad, which avoids it running concurrently with other git operations. Also by making the committer not crash if git fails. What I don't understand is why the pusher then crashed with a STM deadlock. That must be in either the DaemonStatusHandle or the FailedPushMap, and the latter is only used by the pusher. Did the committer's crash somehow break STM? The BlockedIndefinitelyOnSTM exception is described as: -- |The thread is waiting to retry an STM transaction, but there are no -- other references to any @TVar@s involved, so it can't ever continue. If the Committer had a reference to a TVar and crashed, I can sort of see this leading to that exception.. The crash was quite easy to reproduce after the previous commit, but after making the above change, I have yet to see it again. Here's hoping.
* deferred downloadsJoey Hess2012-09-17
| | | | | | | | | | | | | Now when a download is queued and there's no known remote to get it from, it's added to a deferred download list, which will be retried later. The Merger thread tries to queue any deferred downloads when it receives a push to the git-annex branch. Note that the Merger thread now also forces an update of the git-annex branch. The assistant was not updating this branch before, and it saw a (mostly) correct view of state, but now that incoming pushes go to synced/git-annex, it needs to be merged in.
* better name for fallback sync refsJoey Hess2012-09-16
| | | | | | | | | | | Don't expose these as branches in refs/heads/. Instead hide them away in refs/synced/ where only show-ref will find them. Make unused only look at branches and tags, not these other things, so it won't care if some stale sync ref used to use a file. This means they don't need to be deleted, which could have led to an incoming sync being missed.
* ensure outgoing sync pushes always succeed when repo is accessibleJoey Hess2012-09-16
| | | | | | | | | The fallback branches pushed to contain the uuid of the pusher, which is ugly. That's why syncing doesn't normally use this method. The merger deletes fallback branches after merging them, to contain the ugliness, and so unused doesn't look at data from these branches. (The fallback git-annex branch is left behind for now.)
* make the merger merge any equivilant sync branch into the current branchJoey Hess2012-09-16
| | | | Not just synced/master, but synced/UUID/master, for example
* hlintJoey Hess2012-09-13
|
* display errors when any named thread crashesJoey Hess2012-09-06
|
* cleanupJoey Hess2012-08-26
|
* refactorJoey Hess2012-08-22
|
* handle case of adding populated drive to just created repoJoey 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.
* build fixesJoey Hess2012-07-25
|
* debugging improvementsJoey Hess2012-07-20
| | | | | | add timestamps to debug messages Add lots of debug output in the assistant's threads.
* MVar deadlock problem seems to be fixed by previous commitJoey Hess2012-06-28
|
* improve thread termination handlingJoey Hess2012-06-28
| | | | | | | | | | The reason the DirWatcher had to wait for program termination was because it used withINotify, so when it finished, its watcher threads were killed. But since I have two DirWatcher threads now, that was not good, and could perhaps explain the MVar problem I saw yesterday. In any case, fixed this part of the code by making the DirWatcher return a handle that can be used to stop it, and now the main Assistant thread is the only one calling waitForTermination.