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

Re: Rename handling

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Mar 19, 2007, 20:34 UTC
Message-ID
<Pine.LNX.4.64.0703191323490.6730@woody.linux-foundation.org>
In-Reply-To
<200703192102.20258.robin.rosenberg.lists@dewire.com>
On Mon, 19 Mar 2007, Robin Rosenberg wrote:
Show 6 quoted lines
> 
> How about this simple receipe for defeating rename tracking (real world):
> 
> User needs to modify A. User renames A to OLD_A within his/her IDE. SCM
> records the rename. User now uses SaveAs to restore A, and SCM detects the 
> *NEW* file A.

Well, the thing is, I don't think that's a very strong argument against rename tracking.

You can always make trivial examples of when something goes wrong. Computers (and SCM's) are stupid, and they simply do what they are told. Just about *any* policy can be trivially show to be "totally broken" by having a user do something - usually something very simple - that breaks it on purpose.

Similarly, I don't think it's hard to show examples of where git's "content is king" does something that the user thinks could be done much better. And similarly, I don't think that's an argument against the content model that git uses.

No, the reason I like the content model is that there is never any hidden state that doesn't matter for the user. If you're a physicist, you could say that yhere is never any "action at a distance" with git. There are no hidden linkages that aren't obvious in the source tree that you commit or work on.

In contrast, the very *definition* of "explicit rename tracking" is to track those hidden linkages. They aren't visible to the developer, except when they clash, and that very invisibility is what makes both mistakes so easy (anybody who claims that they never do a rename as a del/add pair is simply lying or not doing very interesting development) *and* it is what makes handling merges so hard (because when there is a conflict, the conflict isn't actually in anything that is *visible*!).

I also pretty much guarantee that the reason git development has been so fast, stable and trouble-free comes exactly from the simple conceptual mindset and very concrete implementation. There simply are never any subtle issues. Content is content is content. It has no "history". Yes, git shows history, but it's literally a "series of snapshots", and the trees that are checked out are totally history-less.

In contrast, if you have file rename tracking, then those trees are no longer stateless - they have an implied history associated with them, that matters. It's largely *invisible*, but that just makes it worse!

			Linus
Previous: Robin RosenbergNext: Steven Grimm
Message 10 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.