]> git.ipfire.org Git - thirdparty/git.git/commit - fast-import.c
Teach fast-import to recursively copy files/directories
authorShawn O. Pearce <spearce@spearce.org>
Sun, 15 Jul 2007 05:40:37 +0000 (01:40 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Sun, 15 Jul 2007 05:41:23 +0000 (01:41 -0400)
commitb6f3481bb456acbbb990a1045344bb06e5a40283
tree75457994dbd8f190b5f5887b816481e936a7e7d8
parent48b4c3d5ab1610c6dc0198fe94334d78e8a82e16
Teach fast-import to recursively copy files/directories

Some source material (e.g. Subversion dump files) perform directory
renames by telling us the directory was copied, then deleted in the
same revision.  This makes it difficult for a frontend to convert
such data formats to a fast-import stream, as all the frontend has
on hand is "Copy a/ to b/; Delete a/" with no details about what
files are in a/, unless the frontend also kept track of all files.

The new 'C' subcommand within a commit allows the frontend to make a
recursive copy of one path to another path within the branch, without
needing to keep track of the individual file paths.  The metadata
copy is performed in memory efficiently, but is implemented as a
copy-immediately operation, rather than copy-on-write.

With this new 'C' subcommand frontends could obviously implement an
'R' (rename) on their own as a combination of 'C' and 'D' (delete),
but since we have already offered up 'R' in the past and it is a
trivial thing to keep implemented I'm not going to deprecate it.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Documentation/git-fast-import.txt
fast-import.c
t/t9300-fast-import.sh