Re: GIT_INDEX_FILE relative path breaks in subdir

2016-05-23 Thread Junio C Hamano
Joey Hess writes: >> I am not sure if relative to PWD is useful. If it were relative to >> either the GIT_DIR or the GIT_WORK_TREE, i.e. a fixed point, then >> you can set and export GIT_INDEX_FILE and chdir around without >> having to adjust it. If it were relative to PWD, you would need to >>

Re: GIT_INDEX_FILE relative path breaks in subdir

2016-05-23 Thread Joey Hess
Junio C Hamano wrote: > I personally think that it would be OK as long as we do not change > behaviours for those who do not use core.worktree, $GIT_DIR and/or > $GIT_WORK_TREE and change behaviour for others to match that > behaviour, simply because the plain vanilla no-configuration would > be us

Re: GIT_INDEX_FILE relative path breaks in subdir

2016-05-23 Thread Junio C Hamano
Joey Hess writes: > I feel it should be made consistently relative to top of work tree. > > Seems fairly unlikely that any scripts driving git rely on it > being relative to the pwd when GIT_WORK_TREE etc is set. Oh, I do agree that the current status may be a sign that nobody that is cautious t

Re: GIT_INDEX_FILE relative path breaks in subdir

2016-05-23 Thread Joey Hess
Junio C Hamano wrote: > Joey Hess writes: > > > This seems to make it basically impossible for any program that wants to > > use GIT_INDEX_FILE to use anything other than an absolute path; > > there are too many configurations to keep straight that could change how > > git interprets what should

Re: GIT_INDEX_FILE relative path breaks in subdir

2016-05-23 Thread Junio C Hamano
Joey Hess writes: > This seems to make it basically impossible for any program that wants to > use GIT_INDEX_FILE to use anything other than an absolute path; > there are too many configurations to keep straight that could change how > git interprets what should be a simple relative path to a fil

Re: GIT_INDEX_FILE relative path breaks in subdir

2016-05-22 Thread Joey Hess
This is actually worse than I thought; when git is being run with a detached work tree, GIT_INDEX_FILE is treated as a path relative to CWD, instead of the normal behavior of relative the top of the work tree. Normal and expected (according to this thread anyway): joey@darkstar:~/src/other/git/Do

Re: GIT_INDEX_FILE relative path breaks in subdir

2016-05-17 Thread Joey Hess
Junio C Hamano wrote: > Joey Hess writes: > > > Appears to be a bug in git. Seems that it's assuming GIT_INDEX_FILE is > > relative to the top of the worktree and not to the CWD. > > I think that has always been the case. You can always specify it as > relative to the top. Of course, you can u

Re: GIT_INDEX_FILE relative path breaks in subdir

2016-05-17 Thread Junio C Hamano
Joey Hess writes: > Appears to be a bug in git. Seems that it's assuming GIT_INDEX_FILE is > relative to the top of the worktree and not to the CWD. I think that has always been the case. You can always specify it as relative to the top. Of course, you can use absolute. -- To unsubscribe from

GIT_INDEX_FILE relative path breaks in subdir

2016-05-17 Thread Joey Hess
joey@darkstar:/tmp>git init test Initialized empty Git repository in /tmp/test/.git/ joey@darkstar:/tmp>cd test joey@darkstar:/tmp/test>mkdir sub joey@darkstar:/tmp/test>cd sub joey@darkstar:/tmp/test/sub>GIT_INDEX_FILE=../.git/otherindex git write-tree fatal: Unable to create '/tmp/test/../.git/ot