This commit is contained in:
Asureus 2017-01-15 14:34:40 +00:00 committed by admin
parent 31857bec77
commit dc2d53e83a

View file

@ -0,0 +1,181 @@
### Please describe the problem.
A seemingly harmless script causes data loss by dropping last copy of file content.
In my test this script only drops file content on Windows. On Linux it's working good, even on a crippled filesystem.
### What steps will reproduce the problem?
run the following script test.sh:
[[!format sh """
mkdir a
cd a
git init
git annex init first
mkdir folder
echo foo > folder/1.txt
git annex add .
git annex sync
cd ..
git clone a b
cd b
git annex init second
git annex sync
cd ../a
git remote add second ../b
git annex sync
git annex move --to second
git annex sync
mv folder folder1
git annex add
git annex sync
cd ../b
git annex sync
"""]]
### What version of git-annex are you using? On what operating system?
git-annex version: 6.20161231-gc8eeb17
Windows 10.0.14393 and also Windows 8
### Please provide any additional information below.
[[!format sh """
# a complete transcript of the problem occurring.
$ ./test.sh
Initialized empty Git repository in A:/a/.git/
init first
Detected a filesystem without fifo support.
Disabling ssh connection caching.
Detected a crippled filesystem.
Enabling direct mode.
ok
(recording state in git...)
add folder/1.txt ok
(recording state in git...)
commit ok
Cloning into 'b'...
done.
init second
Detected a filesystem without fifo support.
Disabling ssh connection caching.
Detected a crippled filesystem.
(merging origin/git-annex into git-annex...)
(recording state in git...)
Enabling direct mode.
ok
(recording state in git...)
commit ok
pull origin
ok
push origin
Counting objects: 6, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (6/6), 664 bytes | 0 bytes/s, done.
Total 6 (delta 0), reused 0 (delta 0)
To A:/a
* [new branch] git-annex -> synced/git-annex
ok
commit ok
pull second
From ../b
* [new branch] annex/direct/master -> second/annex/direct/master
* [new branch] git-annex -> second/git-annex
* [new branch] master -> second/master
* [new branch] synced/master -> second/synced/master
ok
move folder/1.txt (to second...)
1.txt
4 100% 0.00kB/s 0:00:00 (xfr#1, to-chk=0/1)
(checksum...) ok
(recording state in git...)
commit ok
pull second
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 5 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (5/5), done.
From ../b
fd774cb..1aba4de git-annex -> second/git-annex
ok
(merging second/git-annex into git-annex...)
(recording state in git...)
push second
Counting objects: 10, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (10/10), 827 bytes | 0 bytes/s, done.
Total 10 (delta 3), reused 0 (delta 0)
To ../b
* [new branch] git-annex -> synced/git-annex
ok
add folder1/1.txt ok
(recording state in git...)
commit (recording state in git...)
ok
pull second
ok
push second
Counting objects: 7, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (7/7), 687 bytes | 0 bytes/s, done.
Total 7 (delta 0), reused 0 (delta 0)
To ../b
7ba3e8a..ee8025b git-annex -> synced/git-annex
0758cf9..6e91185 annex/direct/master -> synced/master
ok
commit ok
merge synced/master
Updating 0758cf9..6e91185
Fast-forward
{folder => folder1}/1.txt | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {folder => folder1}/1.txt (100%)
error: duplicate parent 6e91185c7c64569b275a09be1a104a1d8955e1fb ignored
ok
pull origin
From A:/a
0758cf9..6e91185 annex/direct/master -> origin/annex/direct/master
fd774cb..ee8025b git-annex -> origin/git-annex
0758cf9..6e91185 master -> origin/master
0758cf9..6e91185 synced/master -> origin/synced/master
ok
push origin
Counting objects: 1, done.
Writing objects: 100% (1/1), 185 bytes | 0 bytes/s, done.
Total 1 (delta 0), reused 0 (delta 0)
To A:/a
fd774cb..ee8025b git-annex -> synced/git-annex
6e91185..a886805 annex/direct/master -> synced/master
ok
$ # script done here
$ cd b
$ git annex whereis
whereis folder1/1.txt (1 copy)
2a9ef292-1729-4533-ac50-f68d2d0badb6 -- second [here]
ok
$ cat folder1/1.txt
../.git/annex/objects/W5/55/SHA256E-s4--b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c.txt/SHA256E-s4--b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c.txt
$ git annex get
get folder1/1.txt (not available)
No other repository is known to contain the file.
failed
git-annex: get: 1 failed
# End of transcript or log.
"""]]
### Conclusion
I'm so attracted to git-annex's idea, but seems it's still not robust enough to use on Windows platform - v5 direct mode repo is as far as I can get, yet it still throws away my data like this...