CI to automate build of cargo lockfiles on different Alpine releases for git-annex aports https://gitlab.alpinelinux.org/alpine/aports/-/tree/master/community/git-annex
Find a file
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
Annex detect and recover from branch push/commit race 2011-12-11 20:41:35 -04:00
Backend Prevent key names from containing newlines. 2011-12-06 13:03:09 -04:00
Build moved files around 2011-08-20 16:11:42 -04:00
Command separate operations 2011-12-10 12:21:22 -04:00
Common lint 2011-11-11 01:52:58 -04:00
debian slow, stupid, and safe index updating 2011-12-11 15:05:53 -04:00
doc detect and recover from branch push/commit race 2011-12-11 20:41:35 -04:00
Git hslint 2011-12-09 01:57:13 -04:00
Logs hslint 2011-12-09 01:57:13 -04:00
Messages status --json --fast for esc 2011-11-14 19:27:22 -04:00
Remote ensure local remote is initialized when copying to it 2011-12-10 19:54:20 -04:00
Types Fix caching of decrypted ciphers, which failed when drop had to check multiple different encrypted special remotes. 2011-12-08 16:01:46 -04:00
Upgrade hslint 2011-12-09 01:57:13 -04:00
Utility avoid some read 2011-12-09 18:57:09 -04:00
.gitattributes decruft 2011-06-22 18:56:08 -04:00
.gitignore split groups of related functions out of Utility 2011-08-22 16:14:12 -04:00
Annex.hs Fix caching of decrypted ciphers, which failed when drop had to check multiple different encrypted special remotes. 2011-12-08 16:01:46 -04:00
Backend.hs Prevent key names from containing newlines. 2011-12-06 13:03:09 -04:00
CHANGELOG symlinks 2010-10-27 15:14:59 -04:00
Checks.hs lint 2011-11-11 01:52:58 -04:00
CmdLine.hs hslint 2011-12-09 01:57:13 -04:00
Command.hs factor out a stopUnless 2011-12-09 12:23:45 -04:00
Common.hs refactor 2011-12-03 09:10:23 -04:00
Config.hs avoid some read 2011-12-09 18:57:09 -04:00
configure.hs hslint 2011-12-09 01:57:13 -04:00
Crypto.hs factored out some useful error catching methods 2011-11-10 20:57:28 -04:00
git-annex-shell.hs When not run in a git repository, git-annex can still display a usage message, and "git annex version" even works. 2011-11-16 00:49:09 -04:00
git-annex.cabal version dependency on old monad-control 2011-12-10 12:56:02 -04:00
git-annex.hs renamed GitRepo to Git 2011-06-30 13:21:39 -04:00
git-union-merge.hs optimize index updating 2011-12-11 16:14:59 -04:00
Git.hs optimize index updating 2011-12-11 16:14:59 -04:00
GitAnnex.hs 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
GPL symlinks 2010-10-27 15:14:59 -04:00
Init.hs reorder repo parameters last 2011-11-08 16:27:20 -04:00
INSTALL symlinks 2010-10-27 15:14:59 -04:00
Limit.hs --inbackend can be used to make git-annex only operate on files whose content is stored using a specified key-value backend. 2011-11-28 17:45:47 -04:00
Locations.hs optimize index updating 2011-12-11 16:14:59 -04:00
Makefile add make fast target 2011-11-10 03:10:17 -04:00
mdwn2man mwdn2man: Fix a bug in newline supression. Closes: #606578 2010-12-10 17:27:02 -04:00
Messages.hs Flush json output, avoiding a buffering problem that could result in doubled output. 2011-11-25 11:51:06 -04:00
Options.hs refactoring and cleanup 2011-10-30 00:28:22 -04:00
README add README 2011-05-13 19:20:54 -04:00
Remote.hs status: Include all special remotes in the list of repositories. 2011-11-18 13:22:48 -04:00
Seek.hs lint 2011-11-11 01:52:58 -04:00
Setup.hs cabal can now be used to build git-annex. 2011-06-30 14:55:03 -04:00
test.hs hslint 2011-12-09 01:57:13 -04:00
Types.hs add a UUID type 2011-11-07 15:59:16 -04:00
Upgrade.hs rename 2011-10-05 16:02:51 -04:00

git-annex allows managing files with git, without checking the file
contents into git. While that may seem paradoxical, it is useful when
dealing with files larger than git can currently easily handle, whether due
to limitations in memory, checksumming time, or disk space.

For documentation, see doc/ or <http://git-annex.branchable.com/>