]> dgit.raspbian.org Git - git-annex.git/commitdiff
update proxied exporttree=yes remote on receive of sync branch
authorJoey Hess <joeyh@joeyh.name>
Wed, 7 Aug 2024 17:11:06 +0000 (13:11 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 7 Aug 2024 17:11:06 +0000 (13:11 -0400)
Since git-annex sync sends the sync branch first, and only displays the
output of the push to the sync branch, this makes git-annex
post-retrieve's output when updating the exported tree be visible when
syncing.

This also makes syncing with a non-bare repository still update the
exported tree, even when the checked out branch is not able to be
updated. The sync branch gets sent regardless.

Command/PostReceive.hs
Command/Sync.hs
doc/todo/git-annex_proxies.mdwn

index 351ca50fa8f3c51bd8b87d7b131217cd78d90123..0eca65354f2cbe8d89267bbff63e44f7a041efd8 100644 (file)
@@ -22,6 +22,7 @@ import Git.Types
 import Git.Sha
 import qualified Git.Ref
 import Command.Export (filterExport, getExportCommit, seekExport)
+import Command.Sync (syncBranch)
 
 import qualified Data.Set as S
 import qualified Data.ByteString as B
@@ -59,7 +60,8 @@ proxyExportTree = do
                pushedbranches <- liftIO $ 
                        S.fromList . map snd . parseHookInput
                                <$> B.hGetContents stdin
-               let waspushed = flip S.member pushedbranches
+               let waspushed b = S.member b pushedbranches
+                       || S.member (syncBranch b) pushedbranches
                case filter (waspushed . Git.Ref.branchRef . fst . snd) rbs of
                        [] -> return ()
                        rbs' -> forM_ rbs' $ \((r, b), _) -> go r b
index 82f9826873a0488f3b14fbc66823b415c191f717..3478c2a683afd61db6ea9724137225b0c8bfdc2a 100644 (file)
@@ -28,6 +28,7 @@ module Command.Sync (
        parseUnrelatedHistoriesOption,
        SyncOptions(..),
        OperationMode(..),
+       syncBranch,
 ) where
 
 import Command
index 15c01e981d24a9c714089c42ab5c489f159acedc..6607280dc38c31cf786036870e5390ed44d33996 100644 (file)
@@ -33,9 +33,6 @@ Planned schedule of work:
 * Working on `exportreeplus` branch which is groundwork for proxying to
   exporttree=yes special remotes. Need to merge it to master.
 
-* `git-annex sync` hides output of git-annex post-retreive, which is a
-  problem when it's doing things that are expensive.
-
 * Handle cases where a single key is used by multiple files in the exported
   tree. Need to download from the special remote in order to export
   multiple copies to it. (In particular, this is needed when using