summaryrefslogtreecommitdiff
path: root/doc/bugs/dropping_and_re-adding_from_web_remotes_doesn__39__t_work.mdwn
blob: 30327ba1fc9b73195bb18c40083e509559e56ebd (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
In experimenting with the web remote, I found that dropping a URL gave an error, but still succeeded, while re-adding the same URL fails to work correctly.

#What steps will reproduce the problem?

<pre>
/tmp $ dd if=/dev/zero of=/tmp/file.bin count=1024
1024+0 records in
1024+0 records out
524288 bytes (524 kB) copied, 0.0135652 s, 38.6 MB/s
/tmp $ mkdir /tmp/repo
/tmp $ cd /tmp/repo
/tmp/repo $ git init
Initialized empty Git repository in /tmp/repo/.git/
/tmp/repo $ git annex init "test"
init test ok
(Recording state in git...)
/tmp/repo $ git annex addurl file:///tmp/file.bin --file annexed.bin
######################################################################## 100.0%
(checksum...) ok
(Recording state in git...)
/tmp/repo $ git annex drop annexed.bin 
drop annexed.bin (checking file:///tmp/file.bin...) ok
(Recording state in git...)
/tmp/repo $ mv /tmp/file.bin /tmp/file2.bin 
/tmp/repo $ git annex get annexed.bin 
get annexed.bin (from web...) 
curl: (37) Couldn't open file /tmp/file.bin

  Unable to access these remotes: web

  Try making some of these repositories available:
        00000000-0000-0000-0000-000000000001 -- web
failed
git-annex: get: 1 failed
/tmp/repo $ git annex drop --from web annexed.bin --force
drop web annexed.bin
  removal from web not supported
failed
(Recording state in git...)
git-annex: drop: 1 failed
/tmp/repo $ git annex get annexed.bin 
get annexed.bin (not available) 
  No other repository is known to contain the file.
failed
git-annex: get: 1 failed
/tmp/repo $ mv /tmp/file2.bin /tmp/file.bin 
/tmp/repo $ git annex addurl file:///tmp/file.bin --file annexed.bin
addurl annexed.bin ok
/tmp/repo $ git annex whereis annexed.bin
whereis annexed.bin (0 copies) failed
git-annex: whereis: 1 failed
/tmp/repo $ git annex addurl file:///tmp/file.bin --file annexed2.bin
######################################################################## 100.0%
(checksum...) ok
(Recording state in git...)
/tmp/repo $ git annex whereis annexed.bin
whereis annexed.bin (1 copy)
        e2418e81-ec04-4091-aabe-ed75d65f93fa -- here (test)
ok
/tmp/repo $ git annex whereis annexed2.bin
whereis annexed2.bin (1 copy)
        e2418e81-ec04-4091-aabe-ed75d65f93fa -- here (test)
ok
/tmp/repo $ git annex drop annexed.bin
drop annexed.bin (unsafe)
  Could only verify the existence of 0 out of 1 necessary copies

  No other repository is known to contain the file.

  (Use --force to override this check, or adjust annex.numcopies.)
failed
git-annex: drop: 1 failed
/tmp/repo $ git annex drop annexed2.bin
drop annexed2.bin (unsafe)
  Could only verify the existence of 0 out of 1 necessary copies

  No other repository is known to contain the file.

  (Use --force to override this check, or adjust annex.numcopies.)
failed
git-annex: drop: 1 failed
/tmp/repo $ mv /tmp/file.bin /tmp/file2.bin 
/tmp/repo $ git annex addurl file:///tmp/file2.bin --file annexed.bin
addurl annexed.bin ok
(Recording state in git...)
/tmp/repo $ git annex whereis annexed2.bin 
whereis annexed2.bin (2 copies) 
        00000000-0000-0000-0000-000000000001 -- web
        e2418e81-ec04-4091-aabe-ed75d65f93fa -- here (test)

  web: file:///tmp/file.bin
  web: file:///tmp/file2.bin
ok
/tmp/repo $ mv /tmp/file2.bin /tmp/file.bin 
/tmp/repo $ git annex drop annexed.bin 
drop annexed.bin (checking file:///tmp/file.bin...) ok
(Recording state in git...)
/tmp/repo $ git annex get annexed.bin 
get annexed.bin (from web...) 
######################################################################## 100.0%
ok
(Recording state in git...)
/tmp/repo $ git annex drop annexed.bin 
drop annexed.bin (checking file:///tmp/file.bin...) ok
(Recording state in git...)
/tmp/repo $ mv /tmp/file.bin /tmp/file2.bin 
/tmp/repo $ git annex get annexed.bin 
get annexed.bin (from web...) 
curl: (37) Couldn't open file /tmp/file.bin
######################################################################## 100.0%
ok
(Recording state in git...)
</pre>

#What is the expected output? What do you see inst


When dropping one file and I see "git-annex: drop: 1 failed" I would expect the file to still be in the remote as far as git-annex is concerned.

When re-adding the URL, I expect the file to be re-added to the web remote. (note that it re-appears after adding the same file via a different URL)


#What version of git-annex are you using? On what operating system?


3.20121112 on Gentoo Linux


#Please provide any additional information below.

This seems to be a corner case, and would probably have minimal impact on most people.

> Yeah, dropping from the web is pretty weird.
> 
> I guess it makes sense to do if a website stops having a file and you don't
> want git-annex to try to download from it anymore. So, I've made dropping
> from the web remove all urls associated with the file, rather than failing.
> 
> [[done]] --[[Joey]]