]> dgit.raspbian.org Git - git-annex.git/blob
acb36873f33aa672429d1ca4905f70b3d76d821b
[git-annex.git] /
1 [[!comment format=mdwn
2  username="joey"
3  subject="""comment 5"""
4  date="2018-09-11T18:51:07Z"
5  content="""
6 Unfortunately git 2.11.0 has the bug that I made git-annex look at
7 `GIT_PREFIX` to avoid.
8
9         root@darkstar:/tmp/repo/foo/bar# git --work-tree=../.. ls-files --modified /tmp/repo/
10         BASH_EXECUTION_STRING='set | grep GIT_ >&2; pwd >&2; git-annex smudge --clean '\''subdir/file'\'''
11         GIT_DIR=/tmp/repo/.git
12         GIT_PREFIX=foo/bar/
13         GIT_WORK_TREE=../..
14         /tmp/repo
15
16 So, it's not as simple as not looking at `GIT_PREFIX` at all with this
17 version of git. When `GIT_WORK_TREE` is relative, and `GIT_PREFIX` is set,
18 it needs to combine them to get the actual path to the work tree.
19
20 Perhaps git-annex should only use `GIT_PREFIX` 
21 for fixup of relative `GIT_WORK_TREE`, but not for `GIT_DIR`. I've so
22 far only seen it be needed for `GIT_WORK_TREE`; I only made it also
23 be used for `GIT_DIR` out of an assumption git would be consistent in its
24 bugginess.
25
26 Oh hell, here's another way it fails, with git 2.19:
27
28         joey@darkstar:/tmp/repo/subdir/foo> git --work-tree=../.. status
29         BASH_EXECUTION_STRING='set | grep GIT_ >&2; pwd >&2; git-annex smudge --clean '\''subdir/file'\'''
30         GIT_DIR=/tmp/repo/.git
31         GIT_EXEC_PATH=/usr/lib/git-core
32         GIT_MERGE_AUTOEDIT=no
33         GIT_PAGER=
34         GIT_PREFIX=subdir/foo/
35         GIT_WORK_TREE=.
36         /tmp/repo
37         git-annex: subdir/file: getFileStatus: does not exist (No such file or directory)
38         git-annex: smudge: 1 failed
39
40 That one does not involve `GIT_DIR`, instead `GIT_WORK_TREE` is not relative to
41 `GIT_PREFIX` so the workaround that assumes it is breaks. I guess that we
42 could say that `GIT_DIR` is not relative to some directory in this case,
43 so the `GIT_PREFIX` is irrelevant.
44
45 Kind of feels like git's behavior is so inconsistent and ill-specified
46 that trying to work around the bugs in it is likely to just be a neverending
47 source of bugs.
48
49 Unfortunately the git devs have so far ignored my bug report despite it
50 having an easy test case needing nothing more than a simple shell script to
51 reproduce. And there are plenty of differently broken git versions out there
52 even if they eventually fix it, so it seems git-annex has to deal with this
53 mess somehow.
54
55 I'm going with not using `GIT_PREFIX` for `GIT_DIR` and not for
56 `GIT_WORK_TREE=.` and hope that's enough.
57 """]]