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

Re: [PATCH] diffcore-rename: favour identical basenames

From
Aidan Van Dyk <aidan@highrise.ca>
Date
Jun 22, 2007, 17:51 UTC
Message-ID
<20070622175117.GA16921@yugib.highrise.ca>
In-Reply-To
<Pine.LNX.4.64.0706221626450.4059@racer.site>
* Johannes Schindelin <Johannes.Schindelin@gmx.de> [070622 13:34]:
Show 14 quoted lines
> Hi,
> 
> On Fri, 22 Jun 2007, Andy Parkins wrote:
> 
> > What if two files with different filenames and content converge at some 
> > point in history, then diverge again?  If git is tracking renames merely 
> > by content and picks the wrong one, then the history of fileA suddenly 
> > becomes the history of fileB.
> 
> This is becoming highly ethereal. Like "I could imagine that some day in 
> future, some person could devise a device, that might allow you to do 
> something that I can not explain, because I have not even thought of it".
> 
> IOW show me a reasonable example, and we'll talk business.

The one time the "content-only" rename tracking bit me was the after a merge, resulting in conflicts that were un-nessesary:

-*-*-*-*-A-B-C-D
	  \
	   *-E-*
At A, there were 2 files:
	dir1/foo
	dir2/foo
They were template files that happened to be the same in 2 themes.
In E, "foo" was renamed to "foo-bar" in all the template directories.
Git detected this not as 2 renames, but as:
	dir1/foo-bar renamed from dir1/foo
	dir2/foo-bar copied from dir1/foo
	dir2/foo deleted

Meanwhile, work was happening in B, C, and D, changing foo in both templates identically.

When the branch with E was merged back into ABCD, there was a merge conflict with dir2/foo being deleted in one branch, and editit in the other.

In this case, the simple "basename" comparison wouldn't have even been enough.

But the merge was easy enough (because no edits were made in the E branch to those files, just the renames) that I could resolve it easily.

I don't know if preventing this easy-to-fix merge conflict is worth the necessary "likeness of names" necessary to avoid it...

a.
-- 
Aidan Van Dyk                                             Create like a god,
aidan@highrise.ca                                       command like a king,
http://www.highrise.ca/                                   work like a slave.
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 26 of 44 in “Basename matching during rename/copy detection”
  1. Shawn O. PearceJun 21, 2007
  2. Junio C HamanoJun 21, 2007
  3. Andy ParkinsJun 21, 2007
  4. Junio C HamanoJun 21, 2007
  5. Andy ParkinsJun 21, 2007
  6. Johannes SchindelinJun 21, 2007
  7. Andy ParkinsJun 21, 2007
  8. Matthieu MoyJun 21, 2007
  9. Jeff KingJun 21, 2007
  10. Johannes SchindelinJun 21, 2007
  11. Matthieu MoyJun 21, 2007
  12. Johannes SchindelinJun 21, 2007
  13. Steven GrimmJun 21, 2007
  14. Johannes SchindelinJun 21, 2007
  15. Steven GrimmJun 21, 2007
  16. Johannes SchindelinJun 21, 2007
  17. Linus TorvaldsJun 21, 2007
  18. diffcore-rename: favour identical basenamesJohannes Schindelin, Jun 21, 2007
  19. Jeff KingJun 21, 2007
  20. Johannes SchindelinJun 21, 2007
  21. Linus TorvaldsJun 21, 2007
  22. Junio C HamanoJun 21, 2007
  23. Linus TorvaldsJun 21, 2007
  24. Andy ParkinsJun 22, 2007
  25. Johannes SchindelinJun 22, 2007
  26. Aidan Van DykJun 22, 2007
  27. Johannes SchindelinJun 22, 2007
  28. Jeff KingJun 22, 2007
  29. Johannes SchindelinJun 22, 2007
  30. Johannes SixtJun 22, 2007
  31. Johannes SchindelinJun 22, 2007
  32. 100% (was: [PATCH] diffcore-rename: favour identical basenames)David Kastrup, Jun 22, 2007
  33. Johannes SchindelinJun 22, 2007
  34. Junio C HamanoJun 23, 2007
  35. Johannes SchindelinJun 23, 2007
  36. René ScharfeJun 23, 2007
  37. Johannes SchindelinJun 23, 2007
  38. René ScharfeJun 23, 2007
  39. Johannes SchindelinJun 23, 2007
  40. René ScharfeJun 23, 2007
  41. Johannes SchindelinJun 23, 2007
  42. René ScharfeJun 24, 2007
  43. Junio C HamanoJun 23, 2007
  44. Johannes SchindelinJun 23, 2007

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.