aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs/data_loss_on_Windows__58___git_annex_sync_--no-content_drops_last_copy_unexpectedly.mdwn
blob: 0914278b8a9fd94504c10982513a0cc25255059d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
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 so sad 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...