From: Junio C Hamano Date: Mon, 23 May 2016 19:44:48 GMT Subject: Re: GIT_INDEX_FILE relative path breaks in subdir Message-ID: In-Reply-To: <20160523185258.GA10389@kitenet.net> 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 >> adjust it every time you chdir, no? > > Good point, I had not considered this use case. Although if I set a > long-term environment variable and expect to chdir around, well, that's > what absolute paths are for. All my uses of GIT_INDEX_FILE > are in short-term contexts where the program does not chdir. Same to you. I didn't consider a single-shot $ GIT_INDEX_FILE=./a-temporary-file-here git do something It would be natural if we have that temporary file here where we are in that use case.