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) ++
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
## 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
* 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: