3 subject="""comment 5"""
4 date="2018-09-11T18:51:07Z"
6 Unfortunately git 2.11.0 has the bug that I made git-annex look at
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
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.
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
26 Oh hell, here's another way it fails, with git 2.19:
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
34 GIT_PREFIX=subdir/foo/
37 git-annex: subdir/file: getFileStatus: does not exist (No such file or directory)
38 git-annex: smudge: 1 failed
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.
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
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
55 I'm going with not using `GIT_PREFIX` for `GIT_DIR` and not for
56 `GIT_WORK_TREE=.` and hope that's enough.