git-annex/doc
Joey Hess c4c965d602 detect and recover from branch push/commit race
Dealing with a race without using locking is exceedingly difficult and tricky.
Fully tested, I hope.

There are three places left where the branch can be updated, that are not
covered by the race recovery code. Let's prove they're all immune to the
race:

1. tryFastForwardTo checks to see if a fast-forward can be done,
   and then does git-update-ref on the branch to fast-forward it.

   If a push comes in before the check, then either no fast-forward
   will be done (ok), or the push set the branch to a ref that can
   still be fast-forwarded (also ok)

   If a push comes in after the check, the git-update-ref will
   undo the ref change made by the push. It's as if the push did not come
   in, and the next git-push will see this, and try to re-do it.
   (acceptable)

2. When creating the branch for the very first time, an empty index
   is created, and a commit of it made to the branch. The commit's ref
   is recorded as the current state of the index. If a push came in
   during that, it will be noticed the next time a commit is made to the
   branch, since the branch will have changed. (ok)

3. Creating the branch from an existing remote branch involves making
   the branch, and then getting its ref, and recording that the index
   reflects that ref.

   If a push creates the branch first, git-branch will fail (ok).

   If the branch is created and a racing push is then able to change it
   (highly unlikely!) we're still ok, because it first records the ref into
   the index.lck, and then updating the index. The race can cause the
   index.lck to have the old branch ref, while the index has the newly pushed
   branch merged into it, but that only results in an unnecessary update of
   the index file later on.
2011-12-11 20:41:35 -04:00
..
bugs detect and recover from branch push/commit race 2011-12-11 20:41:35 -04:00
design fix link 2011-11-04 15:51:01 -04:00
download Added a comment 2011-05-28 16:04:51 +00:00
encryption Added a comment: Tahoe-LAFS comes with encryption 2011-05-18 04:32:17 +00:00
forum Added a comment 2011-12-10 19:43:04 +00:00
install update url 2011-11-22 22:13:11 -04:00
news add news item for git-annex 3.20111203 2011-12-03 21:13:29 -04:00
special_remotes fix broken links 2011-11-08 12:23:03 -04:00
templates layout 2011-03-31 16:13:24 -04:00
tips 2011-12-09 10:03:20 +00:00
todo added a branch for the new monad-control 0.3 2011-12-05 22:54:30 -04:00
upgrades fix broken links 2011-11-08 12:23:03 -04:00
use_case layout 2011-04-17 11:44:32 -04:00
users 2011-12-07 03:14:24 +00:00
walkthrough fix broken links 2011-11-08 12:23:03 -04:00
backends.mdwn use SHA256 by default 2011-11-04 15:51:01 -04:00
bare_repositories.mdwn a recipe for setting up a bare remote 2011-11-04 23:19:13 +00:00
bugs.mdwn
comments.mdwn add comments page 2011-03-15 23:25:16 -04:00
contact.mdwn update with irc channel 2011-05-19 15:44:22 -04:00
copies.mdwn update documentation for new, neutered key-value backends 2011-08-28 16:28:38 -04:00
design.mdwn encryption design document 2011-04-03 14:34:00 -04:00
distributed_version_control.mdwn fix broken links 2011-11-08 12:23:03 -04:00
download.mdwn update 2011-07-02 17:14:27 -04:00
encryption.mdwn document encryption 2011-04-16 19:35:02 -04:00
feeds.mdwn add feed aggregator 2011-03-31 16:00:33 -04:00
forum.mdwn
future_proofing.mdwn fix broken links 2011-11-08 12:23:03 -04:00
git-annex-shell.mdwn change footer 2011-12-07 13:17:00 -04:00
git-annex.mdwn sync: New command that synchronises the local repository and default remote, by running git commit, pull, and push for you. 2011-12-09 20:27:22 -04:00
git-union-merge.mdwn change footer 2011-12-07 13:17:00 -04:00
GPL
index.mdwn add link 2011-10-17 14:28:30 -04:00
install.mdwn include --bindir in all cabal install examples 2011-09-25 14:26:05 -04:00
internals.mdwn slow, stupid, and safe index updating 2011-12-11 15:05:53 -04:00
location_tracking.mdwn update 2011-11-27 13:57:56 -04:00
logo.png
logo_small.png
meta.mdwn fix 2011-11-08 12:24:56 -04:00
news.mdwn
not.mdwn point to new extension now in mercurial 2011-11-02 12:02:04 -04:00
repomap.png scaled 2011-03-04 15:15:55 -04:00
special_remotes.mdwn documentation/warning message update for future feature 2011-09-23 18:04:38 -04:00
summary.mdwn split out summary and inline raw 2011-03-06 12:22:56 -04:00
tips.mdwn reorg 2011-10-17 13:56:36 -04:00
todo.mdwn
transferring_data.mdwn update 2011-08-16 21:16:23 -04:00
trust.mdwn dead: A command which says that a repository is gone for good and you don't want git-annex to mention it again. 2011-12-02 16:59:55 -04:00
upgrades.mdwn update 2011-07-08 01:26:18 -04:00
users.mdwn
walkthrough.mdwn remove optimize subcommand; use --auto instead 2011-09-15 13:30:04 -04:00