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

Re: "GIT_INDEX_FILE" environment variable

From
Linus Torvalds <torvalds@osdl.org>
Date
Apr 22, 2005, 22:14 UTC
Message-ID
<Pine.LNX.4.58.0504221503270.2344@ppc970.osdl.org>
In-Reply-To
<7vbr867ecy.fsf@assigned-by-dhcp.cox.net>
On Fri, 22 Apr 2005, Junio C Hamano wrote:
> 
> Almost, with a counter-example.  Please try this yourself:

I agree that what git outputs is always "based on the archive base". But that's an independent issue from "where is the working directory". That's the issue of "how do you want me to print out the results".

To see just how independent that is, think about how git-pasky (and, indeed, standard "show-diff") already prints out the results in a _different_ base than the working directory _or_ the base. Ie the way we already do

	--- a/Makefile
	+++ b/Makefile
	... patch ...
for a patch to "Makefile" in the top-level directory.

IOW, showing pathnames is different from _using_ them. And if you were planning on using the same logic for both, you'd have been making a mistake in the first place.

To _use_ pathnames, you use "pwd". To _show_ them, you use some other mechanism. You must not mix up those two issues, or you'd always get "show-diff" wrong.

I actually think that showing the pathnames is up to the wrapper scripts. Git core really always just works on the "canonical" format.

(And I personally think that "show-diff" is really part of the "wrapper scripts" around git. I wrote it originally just because I needed something to verify the index file handling, not because it's "core" like the other programs. I do _not_ consider "show-diff" to be part of the core git code, really. Same goes for "git-export", btw - for the same reasons. It's not "fundamental").

		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 10 of 14 in “"GIT_INDEX_FILE" environment variable”
  1. Linus TorvaldsApr 21, 2005
  2. Davide LibenziApr 21, 2005
  3. Linus TorvaldsApr 21, 2005
  4. Junio C HamanoApr 22, 2005
  5. Linus TorvaldsApr 22, 2005
  6. Junio C HamanoApr 22, 2005
  7. Petr BaudisApr 22, 2005
  8. Linus TorvaldsApr 22, 2005
  9. Junio C HamanoApr 22, 2005
  10. Linus TorvaldsApr 22, 2005
  11. Junio C HamanoApr 22, 2005
  12. Petr BaudisApr 22, 2005
  13. Linus TorvaldsApr 22, 2005
  14. Zach WelchApr 22, 2005

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.