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

Re: Rename handling

From
Steven Grimm <koreth@midwinter.com>
Date
Mar 19, 2007, 19:57 UTC
Message-ID
<45FEEB0C.3080602@midwinter.com>
In-Reply-To
<Pine.LNX.4.64.0703191145530.6730@woody.linux-foundation.org>
Linus Torvalds wrote:
> It's much worse than that. I will *guarantee* that renames are missed when 
> they come in as traditional patches, for example. That's a 100% error rate 
> right there, not some "1%" one.
>   

That's an argument that the content-based rename detector is valuable and shouldn't be ditched, a sentiment with which I completely agree. It is a fabulous piece of work and handles cases that none of git's competitors get right, such as patches or tracking upstream distributions or tracking renames made by non-git-aware tools.

However, "Should we keep the existing rename detection?" is not the same question as, "Should the user be able to tell the system he's renaming something?" Or rather, given we already have git mv, "Should the system remember that the user has told it he's renaming something?" Right now git is throwing away metadata the user is feeding to it, metadata that could be used to eliminate the chance of a subsequent failure. As long as that metadata is used in *addition* to the existing logic, rather than as a *replacement*, the downside seems minimal. You won't have it in the case of a patch, granted, but that just means patches will use the existing, almost-always-right, rename detection, no harm done.

> So learn to love the bomb. Rename tracking is *wrong*. 
>   

Until someone comes up with a way to make content-based rename detection 100% foolproof in the face of things like frequent self-references in Java or C++ classes, it may be a necessary evil (or at least a worthwhile one.)

-Steve
Previous: Linus TorvaldsNext: Martin Langhoff
Message 5 of 31 in “Rename handling”
  1. John GoerzenMar 19, 2007
  2. Steven GrimmMar 19, 2007
  3. Nicolas PitreMar 19, 2007
  4. Linus TorvaldsMar 19, 2007
  5. Steven GrimmMar 19, 2007
  6. Martin LanghoffMar 19, 2007
  7. Junio C HamanoMar 20, 2007
  8. Linus TorvaldsMar 19, 2007
  9. Robin RosenbergMar 19, 2007
  10. Linus TorvaldsMar 19, 2007
  11. Steven GrimmMar 19, 2007
  12. Steven GrimmMar 19, 2007
  13. Linus TorvaldsMar 19, 2007
  14. Nicolas PitreMar 19, 2007
  15. Daniel BarkalowMar 19, 2007
  16. Andy ParkinsMar 19, 2007
  17. Steven GrimmMar 19, 2007
  18. Jakub NarebskiMar 21, 2007
  19. Johannes SchindelinMar 21, 2007
  20. Steven GrimmMar 21, 2007
  21. Johannes SchindelinMar 21, 2007
  22. Linus TorvaldsMar 21, 2007
  23. Martin LanghoffMar 22, 2007
  24. Jakub NarebskiMar 22, 2007
  25. Martin LanghoffMar 22, 2007
  26. Jakub NarebskiMar 22, 2007
  27. Linus TorvaldsMar 22, 2007
  28. Daniel BarkalowMar 19, 2007
  29. John GoerzenMar 19, 2007
  30. Junio C HamanoMar 19, 2007
  31. Jakub NarebskiMar 21, 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.