git-annex/doc/internals
Joey Hess 6ff4300bd1
proof of concent for push to git bundles with MANIFEST
This is a shell script, so not final code, and it does not use git-annex
at all, but it shows how to push to git bundles, listed in a MANIFEST,
the same as the git-remote-annex program will eventually do.

While developing this, I realized that the design needed to be changed
slightly regarding where refs are stored. Since a push can delete a ref
from a remote, storing each newly pushed ref in a bundle won't work,
because deleting a ref would then entail deleting all old bundles and
re-uploading from scratch. So instead, only the refs in the last bundle
listed in the MANIFEST are the active refs. Any refs in prior bundles
are just old refs that were stored previously (a reflog as it were).

That means that, in a situation where two different people are pushing
to the same special remote from different repos, whoever pushes last
wins. Any refs pushed by the other person earlier will be ignored. This
may not be desirable, and git-annex might be able use the git-annex
branch to detect such situations and rescue the refs that got lost. Even
without such a recovery process though, the refs that the other person
thought they pushed will be preserved in their refs/namespaces/mine, so
a pull followed by a push will generally resolve the situation.

Note that the use of refs/namespaces/mine in the bundle is not really
desirable, and it might be worth making a local clone of the repo in
order to set up the refs that will be put in the bundle. Which seems to
be the only way to avoid needing that. But it does need to maintain
the refs/namespaces/mine/ in the git repo in order to remember what refs
have been pushed to the remote before, in order to include them in the
next bundle pushed. A name that includes the remote uuid will be needed
in the final implementation.

Anyway, this shell script seems to fully work, including incremental
pushing, force pushing, and pushes that delete refs.

Sponsored-by: Brett Eisenberg on Patreon
2024-04-25 16:55:19 -04:00
..
hashing
key_format response 2020-02-20 16:21:34 -04:00
lockdown Added a comment 2022-05-20 18:09:45 +00:00
comment_1_4b8ed353dca4f484b3b6eb463fa02fd8._comment
comment_2_c19232d5cc4976c2e5b014aef6e8d9ec._comment
comment_3_5a26ee5aab274f321a4ea6f8527f53bd._comment
comment_4_81293b180fb09105ec158fdfef73d249._comment
comment_5_354012b6a9ac11160eb926234d38051f._comment
comment_7_7e40f744f9ac7f0403df9d1a2162a516._comment
comment_7_9c82a2878f3feb1b2a95662ed25b234b._comment
comment_8_9dccdd3a9556ceef54e318cd5c8a50ad._comment
comment_9_40442b012886ad698f448c262f0d7f4c._comment
comment_10_c4298babd96b2596bd4f6ad828212c92._comment Added a comment: duplicate objects? 2019-11-30 14:04:17 +00:00
comment_11_9758bb3a17f63b4dcf51742ea482dbe9._comment Added a comment: same contents with different keys 2019-11-30 16:51:58 +00:00
comment_12_f0325cefa5cd53a5a897046606137cef._comment Added a comment: no collisions 2019-11-30 20:37:00 +00:00
comment_13_e45b6fa035a30703618448a0f764f935._comment Added a comment 2019-11-30 21:11:53 +00:00
comment_14_3f62751c2dd041f4ead1c6580ea5eec1._comment Added a comment: hardlinking identical files in annex may break invariants 2019-11-30 21:36:38 +00:00
comment_15_c3d12d14e4d044f39829c5d92f523655._comment Added a comment: migrating... 2019-11-30 22:30:06 +00:00
comment_16_2455c898d6c77a5437a2c1532144bb8a._comment response 2020-02-20 16:26:52 -04:00
comment_17_df13b7e66963a6d2673e49f52afb978a._comment Added a comment: why othertmp to be on the same file system? 2022-12-13 14:15:28 +00:00
comment_18_1adce7945940b9c384c2383261388dd9._comment convert renameFile to moveFile to support cross-device moves 2022-12-20 15:17:50 -04:00
git-remote-annex.mdwn proof of concent for push to git bundles with MANIFEST 2024-04-25 16:55:19 -04:00
hashing.mdwn
key_format.mdwn expand 2020-07-03 14:42:04 -04:00
lockdown.mdwn Added annex.freezecontent-command and annex.thawcontent-command configs 2021-06-21 14:40:52 -04:00
pointer_file.mdwn fully specify the pointer file format 2022-02-23 14:20:31 -04:00