aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs/add_fails_with_v6_repo_when_four_levels_deep.mdwn
blob: da246cda17e9d486a1eb51e32b1a880583d433a8 (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
### Please describe the problem.
I've noticed that adding a modified file to a version 6 repo will throw a number of errors if 'git annex add' is executed four or more directories deep from the git directory.
Though it throws a number of errors, it seems the file is still added normally.
I have also experienced a problem whereby adding a file will replace it with its key (as if I had run 'git annex drop').
I'm not sure if that problem is related.

### What steps will reproduce the problem?
In order to cause the exception, a file already in the repo has to be unlocked, edited, and re-added; this re-adding must take place from four levels below the git directory.
Here is a minimal working example:

    git init
    git annex init --version=6
    mkdir -p 1/2/3/4
    touch 1/2/3/4/foo
    git annex add 1/2/3/4/foo
    git annex sync
    git annex unlock 1/2/3/4/foo
    echo "bar" >> 1/2/3/4/foo
    cd 1/2/3/4
    git annex add foo

Specifically, trying to run 'git annex add foo' will result in the following errors being thrown:

    fatal: '../1/2/3/4/foo' is outside repository
    fatal: '../1/2/3/4/foo' is outside repository
    fatal: '../1/2/3/4/foo' is outside repository
    fatal: '../1/2/3/4/foo' is outside repository
    fatal: '../1/2/3/4/foo' is outside repository
    fatal: '../1/2/3/4/foo' is outside repository
    fatal: '../1/2/3/4/foo' is outside repository
    fatal: '../1/2/3/4/foo' is outside repository
    fatal: '../1/2/3/4/foo' is outside repository
    fatal: '../1/2/3/4/foo' is outside repository
    fatal: '../1/2/3/4/foo' is outside repository
    git-annex: git check-attr EOF: user error
    git-annex: smudge: 1 failed
    error: external filter git-annex smudge --clean %f failed 1
    error: external filter git-annex smudge --clean %f failed
    add foo ok
    (recording state in git...)


### What version of git-annex are you using? On what operating system?
I'm currently running version 6.20160720-g9f0428e on Arch Linux (x86), though I've experienced this problem since at least February.

### Please provide any additional information below.

[[!format sh """
# If you can, paste a complete transcript of the problem occurring here.
# If the problem is with the git-annex assistant, paste in .git/annex/daemon.log
$ git init; git annex init --version=6
Initialized empty Git repository in /mnt/.git/
init  ok 
(recording state in git...)
$ mkdir -p 1/2/3/4
$ touch 1/2/3/4/foo
$ git annex add 1/2/3/4/foo
add 1/2/3/4/foo ok
(recording state in git...)
$ git annex sync
commit 
[master (root-commit) 25e1676] git-annex in
:/mntt
 1 file changed, 1 insertion(+)
 create mode 120000 1/2/3/4/foo
ok
$ git annex unlock 1/2/3/4/foo
unlock 1/2/3/4/foo ok
(recording state in git...)
$ echo "bar" >> 1/2/3/4/foo
$ cd 1/2/3/4
$ git annex add foo --debug
[2016-08-23 14:47:21.764271] read: git
["--git-dir=../../../../.git","--work-tree=../../../..","--literal-pathspecs","ls-files","--others","--exclude-standard","-z","--","foo"]
[2016-08-23 14:47:21.766481] read: git
["--git-dir=../../../../.git","--work-tree=../../../..","--literal-pathspecs","ls-files","--modified","-z","--","foo"]
fatal: '../1/2/3/4/foo' is outside repository
fatal: '../1/2/3/4/foo' is outside repository
fatal: '../1/2/3/4/foo' is outside repository
fatal: '../1/2/3/4/foo' is outside repository
fatal: '../1/2/3/4/foo' is outside repository
fatal: '../1/2/3/4/foo' is outside repository
fatal: '../1/2/3/4/foo' is outside repository
fatal: '../1/2/3/4/foo' is outside repository
fatal: '../1/2/3/4/foo' is outside repository
fatal: '../1/2/3/4/foo' is outside repository
fatal: '../1/2/3/4/foo' is outside repository
git-annex: git check-attr EOF: user error
git-annex: smudge: 1 failed
error: external filter git-annex smudge --clean %f failed 1
error: external filter git-annex smudge --clean %f failed
[2016-08-23 14:47:21.806128] chat: git
["--git-dir=../../../../.git","--work-tree=../../../..","--literal-pathspecs","check-attr","-z","--stdin","annex.backend","annex.numcopies","annex.largefiles","--"]
[2016-08-23 14:47:21.806624] read: git ["--version"]
[2016-08-23 14:47:21.809352] process done ExitSuccess
[2016-08-23 14:47:21.813764] chat: git
["--git-dir=../../../../.git","--work-tree=../../../..","--literal-pathspecs","cat-file","--batch"]
add foo [2016-08-23 14:47:21.818268] read: git
["--git-dir=../../../../.git","--work-tree=../../../..","--literal-pathspecs","symbolic-ref","-q","HEAD"]
[2016-08-23 14:47:21.82027] process done ExitSuccess
[2016-08-23 14:47:21.822862] read: git
["--git-dir=../../../../.git","--work-tree=../../../..","--literal-pathspecs","show-ref","git-annex"]
[2016-08-23 14:47:21.825102] process done ExitSuccess
[2016-08-23 14:47:21.825233] read: git
["--git-dir=../../../../.git","--work-tree=../../../..","--literal-pathspecs","show-ref","--hash","refs/heads/git-annex"]
[2016-08-23 14:47:21.82715] process done ExitSuccess
[2016-08-23 14:47:21.828549] chat: git
["--git-dir=../../../../.git","--work-tree=../../../..","--literal-pathspecs","cat-file","--batch"]
ok
(recording state in git...)
[2016-08-23 14:47:21.832848] feed: xargs
["-0","git","--git-dir=../../../../.git","--work-tree=../../../..","--literal-pathspecs","add","--"]
[2016-08-23 14:47:21.836822] process done ExitSuccess
[2016-08-23 14:47:21.837518] chat: git
["--git-dir=../../../.git","--work-tree=../../../..","--literal-pathspecs","hash-object","-w","--stdin-paths","--no-filters"]
[2016-08-23 14:47:21.838061] feed: git
["--git-dir=../../../.git","--work-tree=../../../..","--literal-pathspecs","update-index","-z","--index-info"]
[2016-08-23 14:47:21.843259] process done ExitSuccess
[2016-08-23 14:47:21.843444] read: git
["--git-dir=../../../.git","--work-tree=../../../..","--literal-pathspecs","show-ref","--hash","refs/heads/git-annex"]
[2016-08-23 14:47:21.847287] process done ExitSuccess
[2016-08-23 14:47:21.847602] read: git
["--git-dir=../../../.git","--work-tree=../../../..","--literal-pathspecs","write-tree"]
[2016-08-23 14:47:21.85106] process done ExitSuccess
[2016-08-23 14:47:21.851221] chat: git
["--git-dir=../../../.git","--work-tree=../../../..","--literal-pathspecs","commit-tree","b4a158d15da89e28ef5c2f1782c5b1e3c6f1176c","--no-gpg-sign","-p","refs/heads/git-annex"]
[2016-08-23 14:47:21.85892] process done ExitSuccess
[2016-08-23 14:47:21.85907] call: git
["--git-dir=../../../.git","--work-tree=../../../..","--literal-pathspecs","update-ref","refs/heads/git-annex","68381bac2ba0f559d37214c30b5e41a404b9c98b"]
[2016-08-23 14:47:21.861978] process done ExitSuccess
# End of transcript or log.
"""]]

### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
I've been happily using git-annex on my laptop and server for almost a year; it's saved me a great deal of time and effort.
Thanks for all your work!