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:07 UTC
Message-ID
<Pine.LNX.4.64.0703191259420.6730@woody.linux-foundation.org>
In-Reply-To
<45FEE869.3040308@midwinter.com>
On Mon, 19 Mar 2007, Steven Grimm wrote:
> 
> Err, then I am *going* to consider it a failure of the tool.
Sure.
And then realize that nothing is perfect.

Git is just *closer* to perfect than any other SCM out there. That doesn't mean that you can never find cases where you consider it failed. It just means that it fails less than the alternatives.

To be perfect, an SCM would have to be able to infer a higher meaning. Who knows - maybe that will happen in a few centuries (or decades, but AI has not had a good track-record so far).

Git tracks exactly the stuff that does *not* require it to infer higher meanings - purely data. I personally consider it one of gits greatest strengths: it never matters *how* you get to some state, or what tools you used (patches, imports from other SCM's, "git mv" with intelligent developers, "git mv" with total clutzes, "plain mv", random monkeys typing, whatever). Git tracks not "intent", but "hard data".

The fact that git then can use that unambiguous hard data to show you interesting patterns is a big deal. But you need to realize that it's an even *bigger* deal that git only traffics in hard data that leaves absolutely no room for mistakes.

Git simply doesn't *care* whether you applied a patch to create the rename, or whether you imported the series from a system that doesn't track renames, or whether you just forgot to do "git mv". You should be really really happy about that.

Btw, the reason -M isn't on by default is not that it's more expensive in CPU-time (it is, but quite frankly, you will never really see that effect in practice). No, the real reason is that if you use "-M" and actually see renames, traditional tools no longer understand the patches. And sadly, there are still too many unwashed and ignorant people out there to make the default patch format be git-specific.

When the revolution comes, and we can shoot everybody who uses anything else, we'll turn -M on by default. Don't despair, comrade!

		Linus
Previous: Steven GrimmNext: Nicolas Pitre
Message 13 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.