]> dgit.raspbian.org Git - git-annex.git/commitdiff
sync --content with annexobjects=true exporttree remotes
authorJoey Hess <joeyh@joeyh.name>
Sat, 3 Aug 2024 15:39:23 +0000 (11:39 -0400)
committerJoey Hess <joeyh@joeyh.name>
Sat, 3 Aug 2024 15:39:23 +0000 (11:39 -0400)
Command/Sync.hs
doc/todo/git-annex_proxies.mdwn

index 62b557ccc7126372e81d3dd37b02a2b5a29f9304..b010c8847e8255a930584cdf4a7769f9492506d1 100644 (file)
@@ -315,7 +315,8 @@ seek' o = startConcurrency transferStages $ do
                                -- importing only downloads new files not
                                -- old files)
                                let shouldsynccontent r
-                                       | isExport r && not (isImport r) = False
+                                       | isExport r && not (isImport r) 
+                                               && not (exportHasAnnexObjects r) = False
                                        | otherwise = True
                                syncedcontent <- withbranch $
                                        seekSyncContent o
@@ -944,7 +945,8 @@ syncFile o ebloom rs af k = do
        wantput r
                | pushOption o == False && operationMode o /= SatisfyMode = return False
                | Remote.readonly r || remoteAnnexReadOnly (Remote.gitconfig r) = return False
-               | isExport r || isImport r = return False
+               | isImport r && not (isExport r) = return False
+               | isExport r && not (exportHasAnnexObjects r) = return False
                | isThirdPartyPopulated r = return False
                | otherwise = wantGetBy True (Just k) af (Remote.uuid r)
        handleput lack inhere
@@ -1147,6 +1149,9 @@ isExport = exportTree . Remote.config
 isImport :: Remote -> Bool
 isImport = importTree . Remote.config
 
+exportHasAnnexObjects :: Remote -> Bool
+exportHasAnnexObjects = annexObjects . Remote.config
+
 isThirdPartyPopulated :: Remote -> Bool
 isThirdPartyPopulated = Remote.thirdPartyPopulated . Remote.remotetype
 
index cc4ce80a52cdfa705d1c551ca18489d96a2b79de..e9562e70a4b12d93c99bf36944cb2c06b4ae20c7 100644 (file)
@@ -33,6 +33,15 @@ Planned schedule of work:
 * Working on `exportreeplus` branch which is groundwork for proxying to
   exporttree=yes special remotes.
 
+* `git-annex sync` with an annexobjects=true special remote, when exporting
+  a subdir that contained a file, which has now been moved out of the
+  subdir, first unexports the file, and then re-uploads it to the remote.
+  This could be avoided if when unexporting, it moves to the annex objects
+  location.
+
+  (Might be worth doing that by default, this would let annexobjects=true
+  special remotes not be untrusted.)
+
 * `git-annex sync --content` to an annexobjects=true special remote should 
   get and put keys that are not in the exported tree to the annexobjects
   location.