Added a comment: theory

This commit is contained in:
http://joeyh.name/ 2014-07-09 18:31:07 +00:00 committed by admin
parent b76295a396
commit 5fe0f1e939

View file

@ -0,0 +1,18 @@
[[!comment format=mdwn
username="http://joeyh.name/"
ip="209.250.56.55"
subject="theory"
date="2014-07-09T18:31:07Z"
content="""
Suppose we have 2 mergeDirect's (A and B) running at the same time somehow, with B around 3 seconds behind A, and this sequence of events occurs:
1. A copies index file to index.lock
2. A stages an empty commit
3. B copies index file to index.lock
4. A finishes its commit, and so renames index.lock back to index.
5. B runs stageMerge
So, B is now running stageMerge with `GIT_INDEX_FILE` pointing to an index.lock that DNE. As noted above, this causes a deletion of all files to get staged by B.
If this is the problem, git-annex could fix it using a real lock file. (The index.lock only prevents other git commands from manipulating the index during the merge.)
"""]]