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

Re: "git-diff-tree -R A B == git-diff-tree B A"?

From
Linus Torvalds <torvalds@osdl.org>
Date
May 20, 2005, 15:57 UTC
Message-ID
<Pine.LNX.4.58.0505200855120.2206@ppc970.osdl.org>
In-Reply-To
<Pine.LNX.4.58.0505200844090.2206@ppc970.osdl.org>
On Fri, 20 May 2005, Linus Torvalds wrote:
Show 7 quoted lines
>
> The only correct way to do name sorting is the one that fsck does in
> "verify_order()". To realize why, you need to realize that "A" (the
> directory) sorts _after_ a filename "A file", because '/' sorts after ' '.  
> 
> In contrast, "A" (the directory) sorts _before_ "ABBA" (the band), because
> '/' sorts before 'B'.

Btw, in case you wonder: the real problem is that we use "cache_name_compare()" on a directory name. The function is (as the name says) designed for full pathnames, not the diff-tree kind of possibly partial basenames.

		Linus
Previous: Linus TorvaldsNext: Linus Torvalds
Message 6 of 9 in “"git-diff-tree -R A B == git-diff-tree B A"?”
  1. Junio C HamanoMay 20, 2005
  2. Linus TorvaldsMay 20, 2005
  3. Junio C HamanoMay 20, 2005
  4. Junio C HamanoMay 20, 2005
  5. Linus TorvaldsMay 20, 2005
  6. Linus TorvaldsMay 20, 2005
  7. Linus TorvaldsMay 20, 2005
  8. Junio C HamanoMay 20, 2005
  9. Simplify "reverse-diff" logic in the diff core.Junio C Hamano, May 20, 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.