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

Re: Handling renames.

From
David Woodhouse <dwmw2@infradead.org>
Date
Apr 14, 2005, 19:20 UTC
Message-ID
<1113506402.12012.218.camel@baythorne.infradead.org>
In-Reply-To
<20050414185841.GA16865@elte.hu>
On Thu, 2005-04-14 at 20:58 +0200, Ingo Molnar wrote:
Show 7 quoted lines
> The thing i tried to avoid was to list long filenames in the commit 
> (because of the tree hierarchy we'd need to do tree-absolute pathnames 
> or something like that, and escape things, and do lookups - duplicating 
> a VFS which is quite bad) - it would be better to identify the rename 
> source and target via its tree object hash and its offset within that 
> tree. Such information could be embedded in the commit object just fine.  
> Something like:

Actually I'm not sure that's true. Let's consider the two main users of this information.

Firstly, because it's what I've been playing with: to list a given file's revision history, I currently work with its filename -- walk the commit objects, inspecting the tree and selecting those commits where the file has changed. If my filename is 'fs/jffs2/inode.c' then I can immediately skip over a commit where the 'fs' entry in the top-level tree is identical to that in the parent, or I can skip a commit where the 'jffs2' entry in the 'fs' subtree is identical to the parent... it's all done on filename, and the {parent, entry} tuple wouldn't help much here; I'd probably have to convert back to a filename anyway.

Secondly, there's merges. I've paid less attention to these (see mail 5 minutes ago) but I think they'd end up operating on the rename information in a very similar way. To find a common ancestor for a given file,, we want to track its name as it changed during history; at that point it's all string compares.

-- 
dwmw2
Previous: Ingo MolnarNext: David Mansfield
Message 7 of 20 in “Handling renames.”
  1. David WoodhouseApr 14, 2005
  2. Linus TorvaldsApr 14, 2005
  3. David WoodhouseApr 14, 2005
  4. Ingo MolnarApr 14, 2005
  5. Linus TorvaldsApr 14, 2005
  6. Ingo MolnarApr 14, 2005
  7. David WoodhouseApr 14, 2005
  8. David MansfieldApr 14, 2005
  9. H. Peter AnvinApr 14, 2005
  10. Linus TorvaldsApr 14, 2005
  11. H. Peter AnvinApr 14, 2005
  12. Zach WelchApr 14, 2005
  13. Andrew Timberlake-NewellApr 14, 2005
  14. Naming the SCM (was Re: Handling renames.)Steven Cole, Apr 14, 2005
  15. Petr BaudisApr 14, 2005
  16. H. Peter AnvinApr 14, 2005
  17. Petr BaudisApr 14, 2005
  18. Peter WilliamsApr 14, 2005
  19. Daniel BarkalowApr 14, 2005
  20. David WoodhouseApr 14, 2005

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.