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

Re: [PATCH] Support wholesale directory renames in fast-import

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jul 10, 2007, 14:14 UTC
Message-ID
<20070710141442.GM4436@spearce.org>
In-Reply-To
<20070710140338.GA18450@informatik.uni-freiburg.de>
Uwe Kleine-K??nig <ukleinek@informatik.uni-freiburg.de> wrote:
Show 7 quoted lines
> David Frech wrote:
> > Now my challenge is that the svn dump doesn't *actually* say "rename
> > a/ to b/"; it says "copy a/ to b/; delete a/", so I have to infer the
> > rename.
> 
> I don't know fast-import very well, but why not doing exactly what the
> dump file suggests:  copy a b; delete a ?

Because there is no copy operator in fast-import. So you cannot do "copy a b". Apparently that's what I should have implemented, as rename in Git really is as simple as the copy/delete pair. Ugh.

Copy isn't really that hard, it just can't be nearly as efficient as rename, as copying a subtree will force me to either duplicate data in memory or reload trees from disk to duplicate data in memory. But its a copy, so data duplication is expected. ;-)

I'll implement a copy opertor soon. Shouldn't be too difficult. Maybe someone else would like to take a shot at implementing it...

-- 
Shawn.
Previous: Uwe Kleine-KönigNext: David Frech
Message 5 of 10 in “how to do directory renames in fast-import”
  1. David FrechJul 10, 2007
  2. Support wholesale directory renames in fast-importShawn O. Pearce, Jul 10, 2007
  3. David FrechJul 10, 2007
  4. Uwe Kleine-KönigJul 10, 2007
  5. Shawn O. PearceJul 10, 2007
  6. David FrechJul 10, 2007
  7. Shawn O. PearceJul 11, 2007
  8. David FrechJul 11, 2007
  9. Rogan DawesJul 10, 2007
  10. Shawn O. PearceJul 10, 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.