From 656efe58861dc621c462eaee6fe795395c0d343c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 7 Jun 2017 13:41:04 -0400 Subject: analysis Also, added a comment to Assistant/Threads/Merger.hs to explain why it only merges from /synced/ branches. --- Assistant/Threads/Merger.hs | 13 +++++--- ...ent_5_aeea3ff59c8493c87c313fbaf7614f20._comment | 36 ++++++++++++++++++++++ 2 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 doc/bugs/bare_remote_is_not_automatically_synced_to_local_repo/comment_5_aeea3ff59c8493c87c313fbaf7614f20._comment diff --git a/Assistant/Threads/Merger.hs b/Assistant/Threads/Merger.hs index 05341db1e..ff98cce5f 100644 --- a/Assistant/Threads/Merger.hs +++ b/Assistant/Threads/Merger.hs @@ -63,13 +63,18 @@ onChange file diverged <- liftAnnex Annex.Branch.forceUpdate when diverged $ queueDeferredDownloads "retrying deferred download" Later - | "/synced/" `isInfixOf` file = - mergecurrent =<< liftAnnex (join Command.Sync.getCurrBranch) + -- Merge only from /synced/ branches, which are pushed by git-annex + -- sync and by remote instances of the assistant. + -- It would be nice to merge other remote tracking branches, + -- but it's hard to get an efficient list of them (git remote -r) + | "/synced/" `isInfixOf` file = mergecurrent | otherwise = noop where changedbranch = fileToBranch file - mergecurrent currbranch@(Just b, _) + mergecurrent = + mergecurrent' =<< liftAnnex (join Command.Sync.getCurrBranch) + mergecurrent' currbranch@(Just b, _) | equivBranches changedbranch b = whenM (liftAnnex $ inRepo $ Git.Branch.changed b changedbranch) $ do debug @@ -81,7 +86,7 @@ onChange file def Git.Branch.AutomaticCommit changedbranch - mergecurrent _ = noop + mergecurrent' _ = noop equivBranches :: Git.Ref -> Git.Ref -> Bool equivBranches x y = base x == base y diff --git a/doc/bugs/bare_remote_is_not_automatically_synced_to_local_repo/comment_5_aeea3ff59c8493c87c313fbaf7614f20._comment b/doc/bugs/bare_remote_is_not_automatically_synced_to_local_repo/comment_5_aeea3ff59c8493c87c313fbaf7614f20._comment new file mode 100644 index 000000000..92241bf51 --- /dev/null +++ b/doc/bugs/bare_remote_is_not_automatically_synced_to_local_repo/comment_5_aeea3ff59c8493c87c313fbaf7614f20._comment @@ -0,0 +1,36 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 5""" + date="2017-06-07T16:40:18Z" + content=""" +This has nothing to do with repository groups; it's the git branch +not getting synced by the assistant when master is updated in the +bare repository. + +This is easy enough to repoduce. + +The assistant relies on `git annex remotedaemon` to notice changes in +remotes, and the remotedaemon only supports remotes accessed via ssh, not +on a local drive. + +The assistant has some special case handling for repositories on +removable drives, which lets those be plugged in and syncs with them. +Removable drives are also why the remotedaemon does not watch repositories +on a local drive. If the drive is removable, the remotedaemon would +keep it always busy, by having directories open for inotify, +and so prevent a clean removal of the drive. + +So, I don't think anything can be done about this, at least in the default +configuration. One workaround it using a ssh url for the remote will +make the remotedaemon watch it for changes. + +I could add a non-default configuration setting that +makes a remote on a local drive be watched for changes. + +But, it's not clear to me why you'd want to have the changes be pushed +in to a repository on a removable drive, rather than pushing/syncing +with the repository where the assistant is running. The assistant would +then sync changes it received on to the removable drive. That seems like a +better setup, will still work when the drive is removed for a while, +and is already supported. +"""]] -- cgit v1.2.3