Merge branch 'master' of ssh://git-annex.branchable.com

This commit is contained in:
Joey Hess 2013-11-14 13:50:19 -04:00
commit b0f7c80378
2 changed files with 107 additions and 0 deletions

View file

@ -0,0 +1,66 @@
[[!comment format=mdwn
username="http://joeyh.name/"
ip="209.250.56.246"
subject="comment 1"
date="2013-11-14T17:06:50Z"
content="""
I verify this bug. And it's specific to direct mode as you say. Here is a shell script which automates the proccess:
[[!format sh \"\"\"
#!/bin/sh
set -e
mkdir test
cd test
git init a
cd a
git annex init
git annex direct
touch firstfile
git annex add firstfile
git annex sync # think this was left out of recipe
cd ..
git clone a b
cd b
git annex direct
echo bbbb > f
git annex add f
git annex sync || true
cd ..
cd a
mkdir f
echo aaaa > f/f
git annex add f/f
git annex sync || true
cd ..
cd b
git annex sync
echo \"after merge:\"
ls
\"\"\"]]
At this point, b only has the file version of f; the directory form has been removed. (Syncing to a of course then does the same thing there.)
And from the trascript, we can see what's going on:
<pre>
Adding f/f
CONFLICT (directory/file): There is a directory with name f in HEAD. Adding f as f~refs_heads_synced_master
Automatic merge failed; fix conflicts and then commit the result.
(Recording state in git...)
f: needs merge
[master 0600854] git-annex automatic merge conflict fix
Merge conflict was automatically resolved; you may want to examine the result.
</pre>
The problem seems to be that direct mode merge does not find the `f~refs_heads_synced_master` created by the merge, so fails to copy it from the temp merge tree into the work tree.
`Command.Sync.cleanConflictCruft` is relevant, but was only made to work in indirect mode, it seems.
----
Obviously, if someone runs into this bug and seems to lose data, they can get the data back by reverting the changes from the automatic merge. Direct mode does preserve file contents when removing them from the work tree in a merge.
"""]]

View file

@ -0,0 +1,41 @@
[[!comment format=mdwn
username="http://joeyh.name/"
ip="209.250.56.246"
subject="comment 1"
date="2013-11-14T17:10:55Z"
content="""
I suspect this might be the same underlying problem as [[bugs/Incorrect merge, direct repos (2)]]. However, I cannot reproduce it using the recipe given.. perhaps something was left out?
I wrote this shell script to try to codify the recipe in a runnable form:
[[!format sh \"\"\"
#!/bin/sh
set -e
mkdir test
cd test
git init a
cd a
git annex init
git annex direct
touch firstfile
git annex add firstfile
git annex sync # think this was left out of recipe
cd ..
git clone a b
cd b
git annex direct
echo bbbb > f
git annex add f
git annex sync || true
cd ..
cd a
echo aaaa > f
git annex add f
git annex sync
\"\"\"]]
At this point, a has 2 variants of f, and no amount of syncing in either repo will cause either variant to go away.
"""]]