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, 16:19 UTC
Message-ID
<Pine.LNX.4.58.0505200913170.2206@ppc970.osdl.org>
In-Reply-To
<Pine.LNX.4.58.0505200844090.2206@ppc970.osdl.org>
On Fri, 20 May 2005, Linus Torvalds wrote:
> 
> The sorting does _not_ just affect files/directories with the same names.  
> It affects files and directories that have the same _beginning_.

Ok, I just pushed out a fix which should get this right (it introduces a new "base_name_compare()" function that knows about these subtleties).

I guess we should add a proper ordering test for all these cases. There's:
 - exact same name, directory vs file
 - different length names, but same in the first characters
	- this one has the subcases of the next character sorting with '/' 
	  or '\0' depending on the type of the shorter filename.
Your previous test handled only the simple "exact same name" case.
		Linus
Previous: Linus TorvaldsNext: Junio C Hamano
Message 7 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.