git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 13/23] fast-export: support done feature

From
Sverre Rabbelier <srabbelier@gmail.com>
Date
Jul 16, 2011, 13:03 UTC
Message-ID
<1310821424-4750-14-git-send-email-srabbelier@gmail.com>
In-Reply-To
<1310821424-4750-1-git-send-email-srabbelier@gmail.com>

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>
---
  Unchanged
 Documentation/git-fast-export.txt |    4 ++++
 builtin/fast-export.c             |    9 +++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-fast-export.txt b/Documentation/git-fast-export.txt
index 781bd6e..e3f8453 100644
--- a/Documentation/git-fast-export.txt
+++ b/Documentation/git-fast-export.txt
@@ -82,6 +82,10 @@ marks the same across runs.
 	allow that.  So fake a tagger to be able to fast-import the
 	output.
 
+--use-done-feature::
+	Start the stream with a 'feature done' stanza, and terminate
+	it with a 'done' command.
+
 --no-data::
 	Skip output of blob objects and instead refer to blobs via
 	their original SHA-1 hash.  This is useful when rewriting the
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index daf1945..becef85 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;
 }
-- 
1.7.5.1.292.g728120
Previous: Sverre RabbelierNext: Sverre Rabbelier
Message 16 of 29 in “remote-helper improvements”
  1. 00/23 remote-helper improvementsSverre Rabbelier, Jul 16, 2011
  2. 01/23 transport-helper: fix minor leak in push_refs_with_exportSverre Rabbelier, Jul 16, 2011
  3. 02/23 t5800: factor out some ref testsSverre Rabbelier, Jul 16, 2011
  4. 03/23 t5800: use skip_all instead of prereqSverre Rabbelier, Jul 16, 2011
  5. 04/23 t5800: document some non-functional parts of remote helpersSverre Rabbelier, Jul 16, 2011
  6. 05/23 git-remote-testgit: import non-HEAD refsSverre Rabbelier, Jul 16, 2011
  7. 06/23 transport-helper: don't feed bogus refs to export pushSverre Rabbelier, Jul 16, 2011
  8. 07/23 git_remote_helpers: push all refs during a non-local exportSverre Rabbelier, Jul 16, 2011
  9. Junio C HamanoJul 17, 2011
  10. Sverre RabbelierJul 23, 2011
  11. 08/23 remote-helpers: export GIT_DIR variable to helpersSverre Rabbelier, Jul 16, 2011
  12. 09/23 remote-curl: accept empty line as terminatorSverre Rabbelier, Jul 16, 2011
  13. 10/23 git-remote-testgit: only push for non-local repositoriesSverre Rabbelier, Jul 16, 2011
  14. 11/23 git-remote-testgit: fix error handlingSverre Rabbelier, Jul 16, 2011
  15. 12/23 fast-import: introduce 'done' commandSverre Rabbelier, Jul 16, 2011
  16. 13/23 fast-export: support done featureSverre Rabbelier, Jul 16, 2011
  17. 14/23 transport-helper: factor out push_update_refs_statusSverre Rabbelier, Jul 16, 2011
  18. 15/23 transport-helper: check status code of finish_commandSverre Rabbelier, Jul 16, 2011
  19. 16/23 transport-helper: use the new done feature where possibleSverre Rabbelier, Jul 16, 2011
  20. 17/23 transport-helper: update ref status after push with exportSverre Rabbelier, Jul 16, 2011
  21. 18/23 transport-helper: change import semanticsSverre Rabbelier, Jul 16, 2011
  22. Dmitry IvankovJul 18, 2011
  23. 19/23 transport-helper: Use capname for refspec capability tooSverre Rabbelier, Jul 16, 2011
  24. 20/23 transport-helper: implement marks location as capabilitySverre Rabbelier, Jul 16, 2011
  25. 21/23 transport-helper: die early on encountering deleted refsSverre Rabbelier, Jul 16, 2011
  26. 22/23 t5800: document inability to push new branch with old contentSverre Rabbelier, Jul 16, 2011
  27. 23/23 t5800: point out that deleting branches does not workSverre Rabbelier, Jul 16, 2011
  28. Jeff KingJul 18, 2011
  29. Sverre RabbelierJul 23, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.