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

Re: Two crazy proposals for changing git's diff commands

From
Linus Torvalds <torvalds@osdl.org>
Date
Feb 9, 2006, 01:21 UTC
Message-ID
<Pine.LNX.4.64.0602081719250.2458@g5.osdl.org>
In-Reply-To
<Pine.LNX.4.64.0602081643570.2458@g5.osdl.org>
On Wed, 8 Feb 2006, Linus Torvalds wrote:
Show 10 quoted lines
> 
> The largest reason for why "git diff" defaults to diffing against the 
> index (and not head) is _literally_ that it's faster. Yes, I'm ashamed, 
> but "git diff HEAD" takes 0.35 seconds for me, and "git diff" takes 0.07
> seconds, and largely based entirely on that (and not "what would users 
> want"), I made the bad choice to default to git-diff-files for the "no 
> arguments" case.
> 
> I hang my head in shame. I just like the _instantness_ of "nothing 
> changed". That's a bad reason for choice of interfaces, though.

Btw, it was kind of luck (but it's definitely true) that the current "git diff" semantics happen to also be what you do want during merges when you try to resolve a conflict (while "git diff HEAD" is much less useful).

So making "git diff" default to diffing against HEAD is actually the wrong thing to do during merging, where the current behaviour is exactly what you'd want.

So I dunno. 
		Linus
Previous: Linus TorvaldsNext: Carl Worth
Message 3 of 30 in “Two crazy proposals for changing git's diff commands”
  1. Carl WorthFeb 9, 2006
  2. Linus TorvaldsFeb 9, 2006
  3. Linus TorvaldsFeb 9, 2006
  4. Carl WorthFeb 9, 2006
  5. Junio C HamanoFeb 9, 2006
  6. Junio C HamanoFeb 9, 2006
  7. Junio C HamanoFeb 9, 2006
  8. Linus TorvaldsFeb 9, 2006
  9. Junio C HamanoFeb 9, 2006
  10. Junio C HamanoFeb 10, 2006
  11. Comments on "status -v" (was: Two crazy proposals for changing git's diff commands)Carl Worth, Feb 10, 2006
  12. Junio C HamanoFeb 10, 2006
  13. Linus TorvaldsFeb 10, 2006
  14. Junio C HamanoFeb 10, 2006
  15. Petr BaudisFeb 10, 2006
  16. Junio C HamanoFeb 10, 2006
  17. Carl WorthFeb 9, 2006
  18. Junio C HamanoFeb 10, 2006
  19. Carl WorthFeb 10, 2006
  20. Junio C HamanoFeb 10, 2006
  21. Carl WorthFeb 10, 2006
  22. Mark WoodingFeb 10, 2006
  23. Catalin MarinasFeb 13, 2006
  24. Prune-safe StGIT (was Re: Two crazy proposals for changing git's diff commands)Catalin Marinas, Feb 13, 2006
  25. Kent EngstromFeb 10, 2006
  26. Junio C HamanoFeb 11, 2006
  27. Add howto about separating topics.kent@lysator.liu.se, Feb 12, 2006
  28. J. Bruce FieldsFeb 12, 2006
  29. Junio C HamanoFeb 12, 2006
  30. Tim LarsonFeb 9, 2006

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.