git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: GIT_INDEX_FILE relative path breaks in subdir

From
Joey Hess <id@joeyh.name>
Date
May 23, 2016, 17:29 UTC
Message-ID
<20160523172951.GA1184@kitenet.net>
In-Reply-To
<xmqqwpmkafmb.fsf@gitster.mtv.corp.google.com>
Junio C Hamano wrote:
Show 11 quoted lines
> Joey Hess <id@joeyh.name> 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 file.
> 
> Thanks for digging.  Perhaps this needs to be documented (not "in
> this case it is take as relative to that, in this other case, ...",
> but "you cannot rely on relative being relative to something you
> think").

Documenting it that way feels like ¯\_(ツ)_/¯ 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.

(I'd prefer relative to pwd because that is much more sane IMHO, but making that change is more likely to break something.)

-- 
see shy jo
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 9 in “GIT_INDEX_FILE relative path breaks in subdir”
  1. Joey HessMay 17, 2016
  2. Junio C HamanoMay 17, 2016
  3. Joey HessMay 17, 2016
  4. Joey HessMay 22, 2016
  5. Junio C HamanoMay 23, 2016
  6. Joey HessMay 23, 2016
  7. Junio C HamanoMay 23, 2016
  8. Joey HessMay 23, 2016
  9. Junio C HamanoMay 23, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.