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

Re: Rename handling

From
Martin Langhoff <martin.langhoff@gmail.com>
Date
Mar 19, 2007, 20:19 UTC
Message-ID
<46a038f90703191319y54251f63ldc6060ffbc89deea@mail.gmail.com>
In-Reply-To
<45FEEB0C.3080602@midwinter.com>
On 3/20/07, Steven Grimm <koreth@midwinter.com> wrote:
> 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?"

How is a $SCM-mv that remembers useful in any _interesting_ scenario? You don't move it just because, you refactor and re-architect something.

In that area, git's mergers still have a bit to go -- I do hope for a day when I can say git-merge -s refactor or just git-merge -s tryharder so that it if hunks don't apply, git will try and trace where the block of code the hunk applies to has gone.

So recording mv doesn't solve anything other than 1% of the cases -- those full file moves that git will discover anyway even if the file changed a bit. And recording the mv gives you a false sense of being useful. It's not.

There's more work in having go-slow-and-really-try-to-merge-across-a-refactor mergers that could at least hint at where the hunk is likely to belong now.

> Until someone comes up with a way to make content-based rename detection
> 100% foolproof in the face of things like frequent self-references

Well, if code changes, there are no guarantees. Patching is a best-effort-but-not-too-smart thing. But in the end, a human needs to look at it if it's tricky. Wiggle users know ;-)

And, at the end of the day, hitting programmers that move sh*t around needlessly in the head works too. You wouldn't let them change projectwide function/method name conventions willy nilly either.

cheers,
martin
Previous: Steven GrimmNext: Junio C Hamano
Message 6 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.