@@ -98,9 +98,10 @@ OPTIONS
9898 options.
9999
100100--cat-blob-fd=<fd>::
101- Specify the file descriptor that will be written to
102- when the `cat-blob` command is encountered in the stream.
103- The default behaviour is to write to `stdout`.
101+ Write responses to `cat-blob` and `ls` queries to the
102+ file descriptor <fd> instead of `stdout`. Allows `progress`
103+ output intended for the end-user to be separated from other
104+ output.
104105
105106--done::
106107 Require a `done` command at the end of the stream.
@@ -942,6 +943,9 @@ This command can be used anywhere in the stream that comments are
942943accepted. In particular, the `cat-blob` command can be used in the
943944middle of a commit but not in the middle of a `data` command.
944945
946+ See ``Responses To Commands'' below for details about how to read
947+ this output safely.
948+
945949`ls`
946950~~~~
947951Prints information about the object at a path to a file descriptor
@@ -991,6 +995,9 @@ instead report
991995 missing SP <path> LF
992996====
993997
998+ See ``Responses To Commands'' below for details about how to read
999+ this output safely.
1000+
9941001`feature`
9951002~~~~~~~~~
9961003Require that fast-import supports the specified feature, or abort if
@@ -1079,6 +1086,35 @@ If the `--done` command line option or `feature done` command is
10791086in use, the `done` command is mandatory and marks the end of the
10801087stream.
10811088
1089+ Responses To Commands
1090+ ---------------------
1091+ New objects written by fast-import are not available immediately.
1092+ Most fast-import commands have no visible effect until the next
1093+ checkpoint (or completion). The frontend can send commands to
1094+ fill fast-import's input pipe without worrying about how quickly
1095+ they will take effect, which improves performance by simplifying
1096+ scheduling.
1097+
1098+ For some frontends, though, it is useful to be able to read back
1099+ data from the current repository as it is being updated (for
1100+ example when the source material describes objects in terms of
1101+ patches to be applied to previously imported objects). This can
1102+ be accomplished by connecting the frontend and fast-import via
1103+ bidirectional pipes:
1104+
1105+ ====
1106+ mkfifo fast-import-output
1107+ frontend <fast-import-output |
1108+ git fast-import >fast-import-output
1109+ ====
1110+
1111+ A frontend set up this way can use `progress`, `ls`, and `cat-blob`
1112+ commands to read information from the import in progress.
1113+
1114+ To avoid deadlock, such frontends must completely consume any
1115+ pending output from `progress`, `ls`, and `cat-blob` before
1116+ performing writes to fast-import that might block.
1117+
10821118Crash Reports
10831119-------------
10841120If fast-import is supplied invalid input it will terminate with a
0 commit comments