]> dgit.raspbian.org Git - git-annex.git/commitdiff
fix http proxying for a local git remote with a relative path
authorJoey Hess <joeyh@joeyh.name>
Sun, 28 Jul 2024 17:31:30 +0000 (13:31 -0400)
committerJoey Hess <joeyh@joeyh.name>
Sun, 28 Jul 2024 17:35:51 +0000 (13:35 -0400)
git-annex-shell expects an absolute path

Remote/Helper/Ssh.hs
doc/todo/git-annex_proxies.mdwn

index f3d1527fa7fd7411a0f9e029c9d574041c8e12c6..3832a885680d04347069de94b56b4de18de3a816 100644 (file)
@@ -44,12 +44,13 @@ toRepo cs r gc remotecmd = do
 git_annex_shell :: ConsumeStdin -> Git.Repo -> String -> [CommandParam] -> [(Field, String)] -> Annex (Maybe (FilePath, [CommandParam]))
 git_annex_shell cs r command params fields
        | not $ Git.repoIsUrl r = do
-               shellopts <- getshellopts
+               dir <- liftIO $ absPath (Git.repoPath r)
+               shellopts <- getshellopts dir
                return $ Just (shellcmd, shellopts ++ fieldopts)
        | Git.repoIsSsh r = do
                gc <- Annex.getRemoteGitConfig r
                u <- getRepoUUID r
-               shellopts <- getshellopts
+               shellopts <- getshellopts (Git.repoPath r)
                let sshcmd = unwords $
                        fromMaybe shellcmd (remoteAnnexShell gc)
                                : map shellEscape (toCommand shellopts) ++
@@ -58,9 +59,8 @@ git_annex_shell cs r command params fields
                Just <$> toRepo cs r gc sshcmd
        | otherwise = return Nothing
   where
-       dir = Git.repoPath r
        shellcmd = "git-annex-shell"
-       getshellopts = do
+       getshellopts dir = do
                debugenabled <- Annex.getRead Annex.debugenabled
                debugselector <- Annex.getRead Annex.debugselector
                let params' = case (debugenabled, debugselector) of
index ce22687b825a7ea762b603c54a53246fb85898e2..e51c725de36eb8635eb574ff494df6c28ff17236 100644 (file)
@@ -28,8 +28,6 @@ Planned schedule of work:
 
 ## work notes
 
-* http proxying for a local git remote seems to probably not work
-
 * An interrupted `git-annex copy --to` a cluster via the http server,
   when repeated, fails. The http server outputs "transfer already in
   progress, or unable to take transfer lock". Apparently a second
@@ -117,6 +115,14 @@ Planned schedule of work:
 
 * Optimise proxy speed. See design for ideas.
 
+* Speed: A proxy to a local git repository spawns git-annex-shell 
+  to communicate with it. It would be more efficient to operate
+  directly on the Remote. Especially when transferring content to/from it.
+  But: When a cluster has several nodes that are local git repositories,
+  and is sending data to all of them, this would need an alternate
+  interface than `storeKey`, which supports streaming, of chunks
+  of a ByteString.
+
 * Use `sendfile()` to avoid data copying overhead when
   `receiveBytes` is being fed right into `sendBytes`.
   Library to use: