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

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

From
DFDavid Frech <nimblemachines@gmail.com>
Date
Jul 10, 2007, 04:16 UTC
Message-ID
<7154c5c60707092116p70aaeb8l90cda9265311b999@mail.gmail.com>
In-Reply-To
<20070710031036.GA9045@spearce.org>
This should do nicely! Thank you!

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.

But your patch makes my import possible, and it wasn't before!
Cheers,
- David
On 7/9/07, Shawn O. Pearce <spearce@spearce.org> wrote:
Show 39 quoted lines
> Some source material (e.g. Subversion dump files) perform directory
> renames without telling us exactly which files in that subdirectory
> were moved.  This makes it hard for a frontend to convert such data
> formats to a fast-import stream, as all the frontend has on hand
> is "Rename a/ to b/" with no details about what files are in a/,
> unless the frontend also kept track of all files.
>
> The new 'R' subcommand within a commit allows the frontend to
> rename either a file or an entire subdirectory, without needing to
> know the object's SHA-1 or the specific files contained within it.
> The rename is performed as efficiently as possible internally,
> making it cheaper than a 'D'/'M' pair for a file rename.
>
> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
> ---
>
>  David Frech <david@nimblemachines.com> wrote:
>  > Git can track file renames implicitly. If I delete and then add (under
>  > a different name) the same content, git will figure that out.
>  >
>  > But if a directory was renamed, I have no way to tell fast-import
>  > about it. I can't delete the directory (using a 'D' command) and then
>  > add it back (with a different name) with all its contents, because my
>  > source material (an svn dump file) doesn't tell me, at that point,
>  > about all the files involved because nothing about them has changed.
>  >
>  > fast-import knows about the contents of the directory I want to
>  > rename, but doesn't give me a primitive to do the rename. Is this
>  > something we need to add? My frontend could keep track of this, but I
>  > would duplicating work that fast-import is already doing.
>
>  Does the following do the trick for you?  It is also available
>  from my fastimport.git master branch:
>
>         git://repo.or.cz/git/fastimport.git      master
>         http://repo.or.cz/r/git/fastimport.git   master
>
>  Yes, it passes all tests...
>
[patch elided]
Previous: Shawn O. PearceNext: Uwe Kleine-König
Message 3 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.