aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs/set_metadata_leaks_from_one___40__staged__41___key_to_another_during_rename_of_file.mdwn
blob: 31bf4cc041e0230bad83c41a01bc8af9745055f8 (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
### Please describe the problem.

spent quite some time trying to figure out WTF I got some files not published due to tag being set...  managed to reproduce in minimal setup -- if I set metadata to a file, rename a file (mv, git add;  or even git mv), and add another file with different content but the same name -- it would obtain metadata of original key/file (unless I commit right after rename)

### What steps will reproduce the problem?

see below

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

6.20170924+gitgd35053009-1~ndall+1

### Please provide any additional information below.

[[!format sh """
$> sudo rm -rf /tmp/repo; mkdir /tmp/repo; cd /tmp/repo; git init; git annex init; echo 1 >| 1; git annex add 1; git commit -m 'added 1'; git annex metadata -s tag=value 1; git mv 1 2; git annex add 2; echo 2>1; git annex add 1; for f in 1 2; do echo "file $f"; ls -l $f; git annex metadata -g tag $f; done                                                                                                                          
Initialized empty Git repository in /tmp/repo/.git/
init  ok
(recording state in git...)
add 1 ok
(recording state in git...)
[master (root-commit) 750d619] added 1
 1 file changed, 1 insertion(+)
 create mode 120000 1
metadata 1 
  lastchanged=2017-09-26@17-59-22
  tag=value
  tag-lastchanged=2017-09-26@17-59-22
ok
(recording state in git...)

add 1 ok
(recording state in git...)
file 1
lrwxrwxrwx 1 yoh yoh 178 Sep 26 13:59 1 -> .git/annex/objects/pX/ZJ/SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
value
file 2
lrwxrwxrwx 1 yoh yoh 178 Sep 26 13:59 2 -> .git/annex/objects/2W/V5/SHA256E-s2--4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865/SHA256E-s2--4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865
value

"""]]

you can see in above taht 1 and 2 have different content/keys, but they both acquire the same tag=value.  If I commit 2 after it being renamed from 1, it is ok.

[[!meta author=yoh]]