git-remote-annex: mostly implemented pushing

Full pushing will probably work, but is untested.
Incremental pushing is not implemented yet.

While a fairly straightforward port of the shell prototype, the details
of exactly how to get the objects to the remote were tricky. And the
prototype did not consider how to deal with partial failures and
interruptions.

I've taken considerable care to make sure it always leaves things in a
consistent state when interrupted or when it loses access to a remote in
the middle of a push.

Sponsored-by: Leon Schuermann on Patreon
This commit is contained in:
Joey Hess 2024-05-09 16:11:16 -04:00
parent 797f27ab05
commit f2d17cf154
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 254 additions and 14 deletions

View file

@ -23,3 +23,16 @@ listHeads bundle repo = map gen . S8.lines <$>
unbundle :: FilePath -> Repo -> IO ()
unbundle bundle = runQuiet [Param "bundle", Param "unbundle", File bundle]
create :: FilePath -> [Ref] -> Repo -> IO ()
create bundle refs repo = pipeWrite
[ Param "bundle"
, Param "create"
, Param "--quiet"
, File bundle
, Param "--stdin"
] repo writerefs
where
writerefs h = do
mapM_ (S8.hPutStrLn h . fromRef') refs
hClose h