@@ -54,7 +54,7 @@ Options for Frontends
5454~~~~~~~~~~~~~~~~~~~~~
5555
5656--cat-blob-fd=<fd>::
57- Write responses to `cat-blob` and `ls` queries to the
57+ Write responses to `get-mark`, ` cat-blob`, and `ls` queries to the
5858 file descriptor <fd> instead of `stdout`. Allows `progress`
5959 output intended for the end-user to be separated from other
6060 output.
@@ -350,6 +350,11 @@ and control the current import process. More detailed discussion
350350 unless the `done` feature was requested using the
351351 `--done` command-line option or `feature done` command.
352352
353+ `get-mark`::
354+ Causes fast-import to print the SHA-1 corresponding to a mark
355+ to the file descriptor set with `--cat-blob-fd`, or `stdout` if
356+ unspecified.
357+
353358`cat-blob`::
354359 Causes fast-import to print a blob in 'cat-file --batch'
355360 format to the file descriptor set with `--cat-blob-fd` or
@@ -930,6 +935,25 @@ Placing a `progress` command immediately after a `checkpoint` will
930935inform the reader when the `checkpoint` has been completed and it
931936can safely access the refs that fast-import updated.
932937
938+ `get-mark`
939+ ~~~~~~~~~~
940+ Causes fast-import to print the SHA-1 corresponding to a mark to
941+ stdout or to the file descriptor previously arranged with the
942+ `--cat-blob-fd` argument. The command otherwise has no impact on the
943+ current import; its purpose is to retrieve SHA-1s that later commits
944+ might want to refer to in their commit messages.
945+
946+ ....
947+ 'get-mark' SP ':' <idnum> LF
948+ ....
949+
950+ This command can be used anywhere in the stream that comments are
951+ accepted. In particular, the `get-mark` command can be used in the
952+ middle of a commit but not in the middle of a `data` command.
953+
954+ See ``Responses To Commands'' below for details about how to read
955+ this output safely.
956+
933957`cat-blob`
934958~~~~~~~~~~
935959Causes fast-import to print a blob to a file descriptor previously
@@ -1000,7 +1024,8 @@ Output uses the same format as `git ls-tree <tree> -- <path>`:
10001024====
10011025
10021026The <dataref> represents the blob, tree, or commit object at <path>
1003- and can be used in later 'cat-blob', 'filemodify', or 'ls' commands.
1027+ and can be used in later 'get-mark', 'cat-blob', 'filemodify', or
1028+ 'ls' commands.
10041029
10051030If there is no file or subtree at that path, 'git fast-import' will
10061031instead report
@@ -1042,9 +1067,11 @@ import-marks-if-exists::
10421067 "feature import-marks-if-exists" like a corresponding
10431068 command-line option silently skips a nonexistent file.
10441069
1070+ get-mark::
10451071cat-blob::
10461072ls::
1047- Require that the backend support the 'cat-blob' or 'ls' command.
1073+ Require that the backend support the 'get-mark', 'cat-blob',
1074+ or 'ls' command respectively.
10481075 Versions of fast-import not supporting the specified command
10491076 will exit with a message indicating so.
10501077 This lets the import error out early with a clear message,
@@ -1124,11 +1151,11 @@ bidirectional pipes:
11241151 git fast-import >fast-import-output
11251152====
11261153
1127- A frontend set up this way can use `progress`, `ls `, and `cat-blob`
1128- commands to read information from the import in progress.
1154+ A frontend set up this way can use `progress`, `get-mark `, `ls`, and
1155+ `cat-blob` commands to read information from the import in progress.
11291156
11301157To avoid deadlock, such frontends must completely consume any
1131- pending output from `progress`, `ls`, and `cat-blob` before
1158+ pending output from `progress`, `ls`, `get-mark`, and `cat-blob` before
11321159performing writes to fast-import that might block.
11331160
11341161Crash Reports
0 commit comments