git-annex/doc
Joey Hess 8b56d6b283
fix conflicting push situation
In a situation where there are two repos that are diverged and each pushes
in turn to git-remote-annex, the first to push updates it. Then the second
push fails because it is not a fast-forward. The problem is, before git
push fails with "non-fast-forward", it actually calls git-remote-annex
with push.

So, to the user it appears as if the push failed, but it actually reached
the remote, and overwrote the other push!

The only solution to this seems to be for git-remote-annex push to notice
when a non-force-push would overwrite a ref stored in the remote, and
refuse to push that ref, returning an error to git. This seems strange,
why would git make remote helpers implement that when it later checks the
same thing itself?

With this fix, it's still possible for a race to overwrite a change to
the MANIFEST and lose work that was pushed from the other repo. But that
needs two pushes to be running at the same time. From the user's
perspective, that situation is the same as if one repo pushed new work,
then the other repo did a git push --force, overwriting the first repo's
push. In the first repo, another push will then fail as a non
fast-forward, and the user can recover as usual. But, a MANIFEST
overwrite will leave bundle files in the remote that are not listed in
the MANIFEST. It seems likely that git-annex will eventually be able to
detect that after the fact and clean it up. Eg, it can learn all bundles
that are stored in the remote using the location log, and compare them
to the MANIFEST to find bundles that got lost.

The race can also appear to the user as if they pushed a ref, but then
it got deleted from the remote. This happens when two two pushes are
pushing different ref names. This might be harder for the user to
notice; git fetch does not indicate that a remote ref got deleted.
They would have to use git fetch --prune to notice the deletion.
Once the user does notice, they can re-push their ref to recover.

Sponsored-by: Jack Hill on Patreon
2024-04-26 15:03:04 -04:00
..
Android
android
assistant
automatic_conflict_resolution
backends Added a comment: combine worm with partial hash 2024-02-01 11:53:54 +00:00
bare_repositories
bugs fix transfer lock file for Download to not include uuid 2024-03-25 14:47:46 -04:00
chunking
coding_style
contribute
copies link comment to todo 2023-06-19 11:42:45 -04:00
design Added a comment: support for bulk write/read/test remote 2024-04-02 06:41:25 +00:00
devblog response 2023-06-28 13:08:12 -04:00
direct_mode
download
encryption
footer
forum Added a comment 2024-03-27 22:11:47 +00:00
future_proofing
git-annex-add
git-annex-addurl promote comment to bug 2023-03-27 14:10:32 -04:00
git-annex-adjust
git-annex-benchmark
git-annex-checkpresentkey
git-annex-config comment 2023-06-23 11:44:49 -04:00
git-annex-copy
git-annex-diffdriver Added a comment: Minimum required version 2023-10-24 14:27:25 +00:00
git-annex-direct
git-annex-drop
git-annex-enableremote
git-annex-find
git-annex-get lookupkey: Added --ref option 2023-09-12 12:49:11 -04:00
git-annex-import
git-annex-importfeed
git-annex-lookupkey
git-annex-matching-options fix a typo 2023-12-18 13:40:23 -04:00
git-annex-metadata
git-annex-move
git-annex-p2p
git-annex-preferred-content
git-annex-reinject
git-annex-repair
git-annex-rmurl
git-annex-setpresentkey
git-annex-sync comment and improve docs 2023-04-19 12:20:26 -04:00
git-annex-test
git-annex-unannex
git-annex-undo
git-annex-uninit move a comment that is a bug report 2023-11-21 15:57:10 -04:00
git-annex-unlock
git-annex-unused
git-annex-webapp Added a comment: Thanks Yann! 2023-11-19 18:20:03 +00:00
git-annex-whereis
git-annex-whereused comment 2023-05-05 13:36:57 -04:00
how_it_works
install Added a comment 2024-01-11 14:15:58 +00:00
internals fix conflicting push situation 2024-04-26 15:03:04 -04:00
license
links
metadata
news Add news of git-annex merch from hellotux.com 2024-03-25 06:27:48 +00:00
not
polls
preferred_content
profiling remove an out of date comment 2023-10-25 13:08:01 -04:00
projects add potential list 2024-03-01 16:54:43 -04:00
required_content
scalability
security
special_remotes Added a comment 2024-04-02 03:56:50 +00:00
stickers
submodules Added a comment 2024-03-05 05:21:59 +00:00
sync this comment section is not a BTS, part N+1 2023-03-21 13:48:34 -04:00
templates
testimonials
thanks update 2024-03-05 13:16:06 -04:00
tips Added a comment: Colocating git-annex and git-lfs 2024-02-22 02:55:26 +00:00
todo mention reversion 2024-04-02 17:33:20 -04:00
trust
tuning Added a comment: Still experimental? 2024-03-06 12:26:56 +00:00
upgrades
use_case
users Mention annextimelog 2024-01-16 23:54:27 +00:00
videos Add link to English re-recording of Yann's git-annex workshop kickoff talk @Tübix2023 2023-12-05 17:18:50 +00:00
walkthrough git-annex pull and push 2023-05-16 16:51:07 -04:00
workflow
Android.mdwn add webapp workaround for nix-on-droid 2023-06-22 21:39:25 +00:00
assistant.mdwn
automatic_conflict_resolution.mdwn
backends.mdwn support VURL backend 2024-02-29 13:48:51 -04:00
bare_repositories.mdwn
bugs.mdwn
builds.mdwn remove appveyor badge, which does not work 2023-03-22 10:55:38 -04:00
chunking.mdwn
coding_style.mdwn
comments.mdwn
contact.mdwn
contribute.mdwn policy on AI generated content 2024-03-18 16:57:54 -04:00
copies.mdwn
design.mdwn
devblog.mdwn
direct_mode.mdwn
distributed_version_control.mdwn
download.mdwn
encryption.mdwn test annex.shared-sop-command 2024-01-10 16:30:38 -04:00
favicon.ico
forum.mdwn
future_proofing.mdwn
git-annex-add.mdwn close bug report and improve docs that led to it being filed 2023-06-12 16:30:21 -04:00
git-annex-addunused.mdwn addunused, dropunused: Support --json and --json-error-messages 2023-05-05 14:01:40 -04:00
git-annex-addurl.mdwn implement URL to VURL migration 2024-03-01 16:42:02 -04:00
git-annex-adjust.mdwn
git-annex-assist.mdwn Revert "multiple -m" 2024-04-02 17:29:07 -04:00
git-annex-assistant.mdwn git-annex assist 2023-05-18 14:37:43 -04:00
git-annex-backends.mdwn
git-annex-benchmark.mdwn
git-annex-calckey.mdwn
git-annex-checkpresentkey.mdwn
git-annex-common-options.mdwn improve match explanations 2023-07-26 15:37:03 -04:00
git-annex-config.mdwn config: Added the --show-origin and --for-file options 2023-06-12 16:24:31 -04:00
git-annex-configremote.mdwn configremote 2023-04-18 15:30:49 -04:00
git-annex-contentlocation.mdwn
git-annex-copy.mdwn copy/move --from-anywhere --to remote 2023-11-30 16:34:30 -04:00
git-annex-dead.mdwn info: Added --dead-repositories option 2023-08-09 12:43:48 -04:00
git-annex-describe.mdwn expire, trust et al, dead, describe: Support --json and --json-error-messages 2023-05-05 15:33:30 -04:00
git-annex-diffdriver.mdwn diffdriver: Added --get option 2023-08-22 11:58:53 -04:00
git-annex-direct.mdwn
git-annex-drop.mdwn Revert "--json-exceptions" 2023-04-25 17:37:34 -04:00
git-annex-dropkey.mdwn Revert "--json-exceptions" 2023-04-25 17:37:34 -04:00
git-annex-dropunused.mdwn dropunused: Support --jobs 2023-07-21 14:03:34 -04:00
git-annex-edit.mdwn
git-annex-enable-tor.mdwn
git-annex-enableremote.mdwn enableremote: Support --json and --json-error-messages 2023-05-10 14:09:27 -04:00
git-annex-examinekey.mdwn fix typo in example 2024-03-01 15:44:46 -04:00
git-annex-expire.mdwn expire, trust et al, dead, describe: Support --json and --json-error-messages 2023-05-05 15:33:30 -04:00
git-annex-export.mdwn git-annex pull and push 2023-05-16 16:51:07 -04:00
git-annex-filter-branch.mdwn
git-annex-filter-process.mdwn
git-annex-find.mdwn avoid quoting spaces in git-annex find output to terminal 2023-04-26 00:18:30 -04:00
git-annex-findkeys.mdwn avoid quoting spaces in git-annex find output to terminal 2023-04-26 00:18:30 -04:00
git-annex-findref.mdwn
git-annex-fix.mdwn fix: Support --json and --json-error-messages 2023-05-04 14:28:21 -04:00
git-annex-forget.mdwn
git-annex-fromkey.mdwn
git-annex-fsck.mdwn Revert "--json-exceptions" 2023-04-25 17:37:34 -04:00
git-annex-fuzztest.mdwn
git-annex-get.mdwn Revert "--json-exceptions" 2023-04-25 17:37:34 -04:00
git-annex-group.mdwn
git-annex-groupwanted.mdwn
git-annex-import.mdwn Revert "multiple -m" 2024-04-02 17:29:07 -04:00
git-annex-importfeed.mdwn support VURL backend 2024-02-29 13:48:51 -04:00
git-annex-indirect.mdwn
git-annex-info.mdwn info: Added "annex sizes of repositories" table to the overall display 2023-12-29 12:09:30 -04:00
git-annex-init.mdwn init: Support --json and --json-error-messages 2023-05-08 14:58:08 -04:00
git-annex-initremote.mdwn initremote: Support --json and --json-error-messages 2023-05-10 14:03:40 -04:00
git-annex-inprogress.mdwn
git-annex-list.mdwn
git-annex-lock.mdwn Revert "--json-exceptions" 2023-04-25 17:37:34 -04:00
git-annex-log.mdwn git-annex log --gnuplot 2023-11-14 14:56:58 -04:00
git-annex-lookupkey.mdwn lookupkey: Added --ref option 2023-09-12 12:49:11 -04:00
git-annex-map.mdwn
git-annex-matchexpression.mdwn --explain for preferred/required content matching 2023-07-26 14:50:04 -04:00
git-annex-matching-expression.mdwn
git-annex-matching-options.mdwn Added --expected-present file matching option 2024-01-25 12:56:41 -04:00
git-annex-merge.mdwn git-annex pull and push 2023-05-16 16:51:07 -04:00
git-annex-metadata.mdwn Revert "--json-exceptions" 2023-04-25 17:37:34 -04:00
git-annex-migrate.mdwn clarification 2024-03-01 17:03:40 -04:00
git-annex-mincopies.mdwn config: Added the --show-origin and --for-file options 2023-06-12 16:24:31 -04:00
git-annex-mirror.mdwn add a warning about --json not being self describing 2023-06-29 15:38:37 -04:00
git-annex-move.mdwn copy/move --from-anywhere --to remote 2023-11-30 16:34:30 -04:00
git-annex-multicast.mdwn
git-annex-numcopies.mdwn config: Added the --show-origin and --for-file options 2023-06-12 16:24:31 -04:00
git-annex-oldkeys.mdwn oldkeys: check associated files by default and add --unchecked 2023-08-23 13:46:41 -04:00
git-annex-p2p.mdwn
git-annex-post-receive.mdwn
git-annex-pre-commit.mdwn
git-annex-preferred-content.mdwn Add missing formatting backtick 2023-08-01 05:32:19 +00:00
git-annex-proxy.mdwn
git-annex-pull.mdwn distributed migration for pull and sync --content 2023-12-08 14:18:18 -04:00
git-annex-push.mdwn document -C behavior with exporttree remotes 2023-09-22 12:40:40 -04:00
git-annex-readpresentkey.mdwn
git-annex-registerurl.mdwn add reregisterurl command 2024-03-05 15:06:14 -04:00
git-annex-reinit.mdwn reinit: Support --json and --json-error-messages 2023-05-08 15:07:40 -04:00
git-annex-reinject.mdwn reinject: Added --guesskeys option 2023-06-26 14:05:31 -04:00
git-annex-rekey.mdwn rekey, setpresentkey: Support --json and --json-error-messages 2023-05-04 16:03:54 -04:00
git-annex-remotedaemon.mdwn
git-annex-renameremote.mdwn configremote 2023-04-18 15:30:49 -04:00
git-annex-repair.mdwn
git-annex-required.mdwn
git-annex-reregisterurl.mdwn add reregisterurl command 2024-03-05 15:06:14 -04:00
git-annex-resolvemerge.mdwn
git-annex-restage.mdwn
git-annex-rmurl.mdwn rmurl: Support --json and --json-error-messages 2023-05-04 11:28:27 -04:00
git-annex-satisfy.mdwn dial back addition, but keep it 2023-11-28 12:03:55 -04:00
git-annex-schedule.mdwn
git-annex-semitrust.mdwn expire, trust et al, dead, describe: Support --json and --json-error-messages 2023-05-05 15:33:30 -04:00
git-annex-setkey.mdwn
git-annex-setpresentkey.mdwn rekey, setpresentkey: Support --json and --json-error-messages 2023-05-04 16:03:54 -04:00
git-annex-shell.mdwn
git-annex-smudge.mdwn
git-annex-status.mdwn Revert "--json-exceptions" 2023-04-25 17:37:34 -04:00
git-annex-sync.mdwn Revert "multiple -m" 2024-04-02 17:29:07 -04:00
git-annex-test.mdwn test annex.shared-sop-command 2024-01-10 16:30:38 -04:00
git-annex-testremote.mdwn improve special remote docs 2024-02-05 15:48:15 -04:00
git-annex-transferkey.mdwn
git-annex-transferkeys.mdwn
git-annex-transferrer.mdwn
git-annex-trust.mdwn expire, trust et al, dead, describe: Support --json and --json-error-messages 2023-05-05 15:33:30 -04:00
git-annex-unannex.mdwn unannex: Support --json and --json-error-messages 2023-05-03 15:56:20 -04:00
git-annex-undo.mdwn migrate, undo: Support --json and --json-error-messages 2023-05-04 16:34:35 -04:00
git-annex-ungroup.mdwn
git-annex-uninit.mdwn uninit: Support --json and --json-error-messages 2023-05-11 13:43:02 -04:00
git-annex-unlock.mdwn Revert "--json-exceptions" 2023-04-25 17:37:34 -04:00
git-annex-unregisterurl.mdwn add reregisterurl command 2024-03-05 15:06:14 -04:00
git-annex-untrust.mdwn expire, trust et al, dead, describe: Support --json and --json-error-messages 2023-05-05 15:33:30 -04:00
git-annex-unused.mdwn oldkeys: New command that lists the keys used by old versions of a file 2023-08-22 14:51:06 -04:00
git-annex-upgrade.mdwn upgrade: Support --json and --json-error-messages and --json-progress 2023-05-10 12:54:48 -04:00
git-annex-vadd.mdwn
git-annex-vcycle.mdwn
git-annex-version.mdwn
git-annex-vfilter.mdwn
git-annex-vicfg.mdwn
git-annex-view.mdwn annex.maxextensionlength for view 2023-03-24 14:01:38 -04:00
git-annex-vpop.mdwn
git-annex-wanted.mdwn
git-annex-watch.mdwn git-annex assist 2023-05-18 14:37:43 -04:00
git-annex-webapp.mdwn webapp: Added --port option, and annex.port config 2024-01-25 14:08:36 -04:00
git-annex-whereis.mdwn Revert "--json-exceptions" 2023-04-25 17:37:34 -04:00
git-annex-whereused.mdwn migrate, undo: Support --json and --json-error-messages 2023-05-04 16:34:35 -04:00
git-annex.mdwn add reregisterurl command 2024-03-05 15:06:14 -04:00
git-remote-tor-annex.mdwn
git-union-merge.mdwn
how_it_works.mdwn
index.mdwn
install.mdwn
internals.mdwn add equivilant key log for VURL keys 2024-02-29 16:01:49 -04:00
license.mdwn
location_tracking.mdwn
logo-old-bw.svg
logo-old.png
logo-old.svg
logo-old_small.png
logo-with-cli.png Add logo version with '> git annex' text below 2024-02-22 11:17:08 -04:00
logo-with-cli.svg Add logo version with '> git annex' text below 2024-02-22 11:17:08 -04:00
logo.mdwn Add link to hellotux.com git-annex shirts 2024-03-25 06:18:36 +00:00
logo.svg
logo_16x16.png
logo_32x32.png
logo_small.png
meta.mdwn
metadata.mdwn
news.mdwn
not.mdwn
polls.mdwn
preferred_content.mdwn
privacy.mdwn
profiling.mdwn
projects.mdwn
publicrepos.mdwn
related_software.mdwn Add borg2annex to related_software 2023-05-28 07:12:15 +02:00
repomap.png
required_content.mdwn
scalability.mdwn
security.mdwn
shortcuts.mdwn
sidebar.mdwn
sitemap.mdwn
special_remotes.mdwn wording 2024-02-05 15:50:41 -04:00
stickers.mdwn
submodules.mdwn
summary.mdwn
sync.mdwn comment and improve docs 2023-04-19 12:20:26 -04:00
testimonials.mdwn
thanks.mdwn update thanks and separate out 2023 name list 2024-02-15 13:24:32 -04:00
tips.mdwn
todo.mdwn
transferring_data.mdwn
trust.mdwn
tuning.mdwn
upgrades.mdwn
users.mdwn
videos.mdwn move new video into feed 2023-07-05 14:54:21 -04:00
walkthrough.mdwn
workflow.mdwn