aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorSverre Rabbelier <srabbelier@gmail.com>2011-07-16 15:03:33 +0200
committerJunio C Hamano <gitster@pobox.com>2011-07-19 11:17:47 -0700
commit82670a5cb57d6a590f261430b6e2b39d09c22900 (patch)
treeb9f9caeead49fa266904c969d55ef29ec432da5e /builtin
parentbe56862f198d946dc75ac7092606e78a4f2ff1d3 (diff)
downloadgit-82670a5cb57d6a590f261430b6e2b39d09c22900.tar.gz
git-82670a5cb57d6a590f261430b6e2b39d09c22900.tar.xz
fast-export: support done feature
If fast-export is being used to generate a fast-import stream that will be used afterwards it is desirable to indicate the end of the stream with the new 'done' command. Add a flag that causes fast-export to end with 'done'. Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/fast-export.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index daf19451b..becef8578 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -26,6 +26,7 @@ static int progress;
static enum { ABORT, VERBATIM, WARN, STRIP } signed_tag_mode = ABORT;
static enum { ERROR, DROP, REWRITE } tag_of_filtered_mode = ABORT;
static int fake_missing_tagger;
+static int use_done_feature;
static int no_data;
static int full_tree;
@@ -627,6 +628,8 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
"Fake a tagger when tags lack one"),
OPT_BOOLEAN(0, "full-tree", &full_tree,
"Output full tree for each commit"),
+ OPT_BOOLEAN(0, "use-done-feature", &use_done_feature,
+ "Use the done feature to terminate the stream"),
{ OPTION_NEGBIT, 0, "data", &no_data, NULL,
"Skip output of blob data",
PARSE_OPT_NOARG | PARSE_OPT_NEGHELP, NULL, 1 },
@@ -648,6 +651,9 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
if (argc > 1)
usage_with_options (fast_export_usage, options);
+ if (use_done_feature)
+ printf("feature done\n");
+
if (import_filename)
import_marks(import_filename);
@@ -675,5 +681,8 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
if (export_filename)
export_marks(export_filename);
+ if (use_done_feature)
+ printf("done\n");
+
return 0;
}