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

Re: Rename handling

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Mar 19, 2007, 19:15 UTC
Message-ID
<Pine.LNX.4.64.0703191425560.6485@iabervon.org>
In-Reply-To
<45FED31B.8070307@midwinter.com>
On Mon, 19 Mar 2007, Steven Grimm wrote:
Show 17 quoted lines
> John Goerzen wrote:
> > 2) For me, a rename is a logical change to the source tree that I want
> >    to be recorded with absolute certainty, not guessed about later.
> >    Sometimes I may make API changes and it is useful to see how module
> >    names changed, with complete precision, later.  I do not want to be
> >    victim to an incorrect guess, which could be possible.
> >   
> 
> If you commit your renames separately from your content changes, it'll be
> unambiguous and you won't have to worry about it. That's what I usually do
> when this is a concern and it has yet to break for me.
> 
> On the other hand, I agree with your general point; I really don't like being
> uncertain about whether renames are going to come out correctly or not ("it
> has always worked before" and "it is by design unable to fail" are two very
> different things.) In particular, I strongly disagree with the "names are just
> syntactic sugar, it's the content we're tracking" philosophy.

We are tracking the names as part of the content. They're right there in the tree objects. It's not like, when you check out an older revision, you could get the right content under the wrong name. The philosophy is actually that we're tracking a series of states, and we're somewhat agnostic on the description of the difference between two states. And it often makes sense to postpone trying to describe this difference until you know why you want to know, because it's certainly possible that there are multiple reasonable interpretations, and some may give better results than others.

If you're trying to merge a rename-and-refactor change (often something like splitting a source or header file into two files) with a modification, and it's arguable what happened in the refactor, the interpretation which gives the state that's easiest to resolve correctly may depend on what the modification is. So you really want to leave it up to the merge code to choose the best guess at the result, without using a fixed description of what the changes are.

As for whether names or contents "matter more", we have both answers. "git log <names>" gives you the history of what has happened to change what appears with those names. "git blame <name>", on the other hand, gives you the history of the content which now appears at that name. You just need to ask the question you want the answer to.

	-Daniel
*This .sig left intentionally blank*
Previous: Linus TorvaldsNext: John Goerzen
Message 28 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.