Code

fast-import: introduce 'done' command
authorSverre Rabbelier <srabbelier@gmail.com>
Sat, 16 Jul 2011 13:03:32 +0000 (15:03 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 Jul 2011 18:17:47 +0000 (11:17 -0700)
commitbe56862f198d946dc75ac7092606e78a4f2ff1d3
tree26eaccb4d28d9fc5d4021dd8a576a00d06ef30fe
parent460d10262dae14b54123ff45e7548d872ff63983
fast-import: introduce 'done' command

Add a 'done' command that causes fast-import to stop reading from the
stream and exit.

If the new --done command line flag was passed on the command line
(or a "feature done" declaration included at the start of the stream),
make the 'done' command mandatory.  So "git fast-import --done"'s
input format will be prefix-free, making errors easier to detect when
they show up as early termination at some convenient time of the
upstream of a pipe writing to fast-import.

Another possible application of the 'done' command would to be allow a
fast-import stream that is only a small part of a larger encapsulating
stream to be easily parsed, leaving the file offset after the "done\n"
so the other application can pick up from there.  This patch does not
teach fast-import to do that --- fast-import still uses buffered input
(stdio).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-fast-import.txt
fast-import.c
t/t9300-fast-import.sh