aboutsummaryrefslogtreecommitdiff
path: root/Documentation/git-fast-import.txt
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-06-30 22:18:19 -0500
committerJunio C Hamano <gitster@pobox.com>2010-07-05 12:11:33 -0700
commit334fba656b50c92345586970bc6b100a449e1fc5 (patch)
treed4d396eb7aa3f04ea616506bf67b486a11df6045 /Documentation/git-fast-import.txt
parent45e9a825edf9064ff76f6ff10357fdc79497f0eb (diff)
downloadgit-334fba656b50c92345586970bc6b100a449e1fc5.tar.gz
git-334fba656b50c92345586970bc6b100a449e1fc5.tar.xz
Teach fast-import to import subtrees named by tree id
To simulate the svn cp command, it would be very useful to be replace an arbitrary file in the current revision by an arbitrary directory from a previous one. Modify the filemodify command to allow that: M 040000 <tree id> pathname This would be most useful in combination with a facility to print the commit ids for new revisions as they are written. Cc: Shawn O. Pearce <spearce@spearce.org> Cc: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-fast-import.txt')
-rw-r--r--Documentation/git-fast-import.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt
index 19082b04e..f4d9aeb13 100644
--- a/Documentation/git-fast-import.txt
+++ b/Documentation/git-fast-import.txt
@@ -482,9 +482,11 @@ External data format::
'M' SP <mode> SP <dataref> SP <path> LF
....
+
-Here `<dataref>` can be either a mark reference (`:<idnum>`)
+Here usually `<dataref>` must be either a mark reference (`:<idnum>`)
set by a prior `blob` command, or a full 40-byte SHA-1 of an
-existing Git blob object.
+existing Git blob object. If `<mode>` is `040000`` then
+`<dataref>` must be the full 40-byte SHA-1 of an existing
+Git tree object or a mark reference set with `--import-marks`.
Inline data format::
The data content for the file has not been supplied yet.
@@ -509,6 +511,8 @@ in octal. Git only supports the following modes:
* `160000`: A gitlink, SHA-1 of the object refers to a commit in
another repository. Git links can only be specified by SHA or through
a commit mark. They are used to implement submodules.
+* `040000`: A subdirectory. Subdirectories can only be specified by
+ SHA or through a tree mark set with `--import-marks`.
In both formats `<path>` is the complete path of the file to be added
(if not already existing) or modified (if already existing).