]> dgit.raspbian.org Git - git-annex.git/commitdiff
avoid trying to export tree to proxied exporttree=yes remotes
authorJoey Hess <joeyh@joeyh.name>
Wed, 7 Aug 2024 17:00:19 +0000 (13:00 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 7 Aug 2024 17:00:19 +0000 (13:00 -0400)
This avoids a lot of ugly messages when syncing with such a remote.
The export tree happens on the proxy side.

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

index 50c1ed8f7736018fec83ebf57d0d143bfce99175..82f9826873a0488f3b14fbc66823b415c191f717 100644 (file)
@@ -305,8 +305,7 @@ seek' o = startConcurrency transferStages $ do
                                -- repositories, in case that lets content
                                -- be dropped from other repositories.
                                exportedcontent <- withbranch $
-                                       seekExportContent (Just o)
-                                               (filter isExport contentremotes)
+                                       seekExportContent (Just o) contentremotes
 
                                -- Sync content with remotes, including
                                -- importing from import remotes (since
@@ -975,7 +974,13 @@ syncFile o ebloom rs af k = do
  - Returns True if any file transfers were made.
  -}
 seekExportContent :: Maybe SyncOptions -> [Remote] -> CurrBranch -> Annex Bool
-seekExportContent o rs (mcurrbranch, madj)
+seekExportContent o rs currbranch =
+       seekExportContent' o (filter canexportcontent rs) currbranch
+  where
+       canexportcontent r = isExport r && not (isProxied r)
+
+seekExportContent' :: Maybe SyncOptions -> [Remote] -> CurrBranch -> Annex Bool
+seekExportContent' o rs (mcurrbranch, madj)
        | null rs = return False
        | otherwise = do
                -- Propagate commits from the adjusted branch, so that
@@ -1147,6 +1152,9 @@ isExport = exportTree . Remote.config
 isImport :: Remote -> Bool
 isImport = importTree . Remote.config
 
+isProxied :: Remote -> Bool
+isProxied = isJust . remoteAnnexProxiedBy . Remote.gitconfig
+
 exportHasAnnexObjects :: Remote -> Bool
 exportHasAnnexObjects = annexObjects . Remote.config
 
index 6dc28249c3e2c465c600bec41f1f45aabb8c289e..15c01e981d24a9c714089c42ab5c489f159acedc 100644 (file)
@@ -33,13 +33,8 @@ 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 --content` now updates a proxied exporttree=yes special
-  remote! But, there are some messages like these that should be avoided:
-
-           Not updating export to origin-d to reflect changes to the tree, because export tracking is not enabled.  (Set remote.origin-d.annex-tracking-branch to enable it.)
-       export origin-d 1
-         export not supported
-       failed
+* `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
@@ -47,6 +42,11 @@ Planned schedule of work:
   `git-annex push`. When using first `git push` followed by
   `git-annex copy --to` the proxied remote, the received key is stored
   to all export locations.)
+
+* Implement `git-annex export treeish --to=foo --from=bar`, which
+  gets from bar as needed to send to foo. Make post-retrieve use
+  `--to=r --from=r` to handle the multiple files case.
+
 * Handle case where the special remote does not support renameExport.
   Each key will need to be downloaded from it in order to export the key
   back to it, if the proxy is to support such a remote.