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:55 UTC
Message-ID
<Pine.LNX.4.58.0504221544190.2344@ppc970.osdl.org>
In-Reply-To
<20050422223341.GC21204@pasky.ji.cz>
On Sat, 23 Apr 2005, Petr Baudis wrote:
> 
> Note that Cogito almost actually does not use show-diff anymore.
> I'm doing diff-cache now, since that is what matters to me.

Indeed. "diff-tree" (between releases) and "diff-cache" (between a release and the current state) are clearly much more fundamental operations.

Also, they have absolutely zero policy, and they're designed to be used with the same scripting engines (ie hopefully you can use just one tool to show the output of either in whatever format you want).

They show you what the canonical names and associated information is, and that's it. What you _do_ with them ends up being outside the scope of git, exactly like it should be. Details like "what format of diff" to produce should be left to the tools around it.

In contrast, "show-diff" was _literally_ written to check what the difference between the "real" file and a "sha1" file was, back when I couldn't write the sha1 files correctly (ie I corrupted anything that didn't fit in the first "[un]compression block", and then calling "diff" to show the difference between the original and the regenerated data was very important).

So "show-diff" just kind of expanded from an early debugging tool to something that _almost_ looks like a real tool. But it's absolutely the right thing to use "diff-tree" and "diff-cache" instead.

			Linus
Previous: Petr BaudisNext: Zach Welch
Message 13 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.