{"thread":{"id":"11014","subject":"[PATCH] Add 'git fast-export', the sister of 'git fast-import'","startedAt":"2007-11-25T21:37:20Z","lastAt":"2007-11-28T12:56:05Z","messageCount":10,"participants":["Johannes Schindelin","Junio C Hamano","Shawn O. Pearce","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"60870","messageId":"Pine.LNX.4.64.0711252236350.4725@wbgn129.biozentrum.uni-wuerzburg.de","threadId":"11014","inReplyTo":null,"subject":"[PATCH] Add 'git fast-export', the sister of 'git fast-import'","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-25T21:37:20Z","receivedAt":"2007-11-25T21:37:20Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nThis program dumps (parts of) a git repository in the format that\nfast-import understands.\n\nFor clarity's sake, it does not use the 'inline' method of specifying\nblobs in the commits, but builds the blobs before building the commits.\n\nSince signed tags' signatures will not necessarily be valid (think\ntransformations after the export, or excluding revisions, changing\nthe history), there are 4 modes to handle them: abort (default),\nignore, warn and strip.  The latter just turns the tags into\nunsigned ones.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n\tThis should be feature complete AFAICT.\n\n .gitignore                        |    1 +\n Documentation/git-fast-export.txt |   83 ++++++++\n Makefile                          |    1 +\n builtin-fast-export.c             |  407 +++++++++++++++++++++++++++++++++++++\n builtin.h                         |    1 +\n git.c                             |    1 +\n t/t9301-fast-export.sh            |  124 +++++++++++\n 7 files changed, 618 insertions(+), 0 deletions(-)\n create mode 100644 Documentation/git-fast-export.txt\n create mode 100755 builtin-fast-export.c\n create mode 100755 t/t9301-fast-export.sh\n\ndiff --git a/.gitignore b/.gitignore\nindex 6564618..8694d02 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -35,6 +35,7 @@ git-diff-files\n git-diff-index\n git-diff-tree\n git-describe\n+git-fast-export\n git-fast-import\n git-fetch\n git-fetch--tool\ndiff --git a/Documentation/git-fast-export.txt b/Documentation/git-fast-export.txt\nnew file mode 100644\nindex 0000000..073ff7f\n--- /dev/null\n+++ b/Documentation/git-fast-export.txt\n@@ -0,0 +1,83 @@\n+git-fast-export(1)\n+==================\n+\n+NAME\n+----\n+git-fast-export - Git data exporter\n+\n+\n+SYNOPSIS\n+--------\n+'git-fast-export [options]' | 'git-fast-import'\n+\n+DESCRIPTION\n+-----------\n+This program dumps the given revisions in a form suitable to be piped\n+into gitlink:git-fast-import[1].\n+\n+You can use it as a human readable bundle replacement (see\n+gitlink:git-bundle[1]), or as a kind of an interactive\n+gitlink:git-filter-branch[1].\n+\n+\n+OPTIONS\n+-------\n+--progress=<n>::\n+\tInsert 'progress' statements every <n> objects, to be shown by\n+\tgitlink:git-fast-import[1] during import.\n+\n+--signed-tags=(ignore|warn|strip|abort)::\n+\tSpecify how to handle signed tags.  Since any transformation\n+\tafter the export can change the tag names (which can also happen\n+\twhen excluding revisions) the signatures will not match.\n++\n+When asking to 'abort' (which is the default), this program will die\n+when encountering a signed tag.  With 'strip', the tags will be made\n+unsigned, with 'ignore', they will be silently ignored (i.e. not exported)\n+and with 'warn', they will be exported, but you will see a warning.\n+\n+\n+EXAMPLES\n+--------\n+\n+-------------------------------------------------------------------\n+$ git fast-export --all | (cd /empty/repository && git fast-import)\n+-------------------------------------------------------------------\n+\n+This will export the whole repository and import it into the existing\n+empty repository.  Except for reencoding commits that are not in\n+UTF-8, it would be a one-to-one mirror.\n+\n+-----------------------------------------------------\n+$ git fast-export master~5..master |\n+\tsed \"s|refs/heads/master|refs/heads/other|\" |\n+\tgit fast-import\n+-----------------------------------------------------\n+\n+This makes a new branch called 'other' from 'master~5..master'\n+(i.e. if 'master' has linear history, it will take the last 5 commits).\n+\n+Note that this assumes that none of the blobs and commit messages\n+referenced by that revision range contains the string\n+'refs/heads/master'.\n+\n+\n+Limitations\n+-----------\n+\n+Since gitlink:git-fast-import[1] cannot tag trees, you will not be\n+able to export the linux-2.6.git repository completely, as it contains\n+a tag referencing a tree instead of a commit.\n+\n+\n+Author\n+------\n+Written by Johannes E. Schindelin <johannes.schindelin@gmx.de>.\n+\n+Documentation\n+--------------\n+Documentation by Johannes E. Schindelin <johannes.schindelin@gmx.de>.\n+\n+GIT\n+---\n+Part of the gitlink:git[7] suite\ndiff --git a/Makefile b/Makefile\nindex 0719fb8..ebd12ed 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -337,6 +337,7 @@ BUILTIN_OBJS = \\\n \tbuiltin-diff-files.o \\\n \tbuiltin-diff-index.o \\\n \tbuiltin-diff-tree.o \\\n+\tbuiltin-fast-export.o \\\n \tbuiltin-fetch.o \\\n \tbuiltin-fetch-pack.o \\\n \tbuiltin-fetch--tool.o \\\ndiff --git a/builtin-fast-export.c b/builtin-fast-export.c\nnew file mode 100755\nindex 0000000..48d0c54\n--- /dev/null\n+++ b/builtin-fast-export.c\n@@ -0,0 +1,407 @@\n+/*\n+ * \"git fast-export\" builtin command\n+ *\n+ * Copyright (C) 2007 Johannes E. Schindelin\n+ */\n+#include \"builtin.h\"\n+#include \"cache.h\"\n+#include \"commit.h\"\n+#include \"object.h\"\n+#include \"tag.h\"\n+#include \"diff.h\"\n+#include \"diffcore.h\"\n+#include \"log-tree.h\"\n+#include \"revision.h\"\n+#include \"decorate.h\"\n+#include \"path-list.h\"\n+#include \"utf8.h\"\n+#include \"parse-options.h\"\n+\n+/*\n+ * TODO:\n+ * - tags (--signed-tags=(ignore|warn|strip|abort)\n+ */\n+\n+static const char *fast_export_usage[] = {\n+\t\"git-fast-export [rev-list-opts]\",\n+\tNULL\n+};\n+\n+static int progress;\n+static enum { IGNORE, WARN, STRIP, ABORT } signed_tag_mode = ABORT;\n+\n+static int parse_opt_signed_tag_mode(const struct option *opt,\n+\t\t const char *arg, int unset)\n+{\n+\tif (unset || !strcmp(arg, \"abort\"))\n+\t\tsigned_tag_mode = ABORT;\n+\telse if (!strcmp(arg, \"ignore\"))\n+\t\tsigned_tag_mode = IGNORE;\n+\telse if (!strcmp(arg, \"warn\"))\n+\t\tsigned_tag_mode = WARN;\n+\telse if (!strcmp(arg, \"strip\"))\n+\t\tsigned_tag_mode = STRIP;\n+\telse\n+\t\treturn error(\"Unknown signed-tag mode: %s\", arg);\n+\treturn 0;\n+}\n+\n+static struct decoration idnums;\n+static uint32_t last_idnum;\n+\n+static int has_unshown_parent(struct commit *commit)\n+{\n+\tstruct commit_list *parent;\n+\n+\tfor (parent = commit->parents; parent; parent = parent->next)\n+\t\tif (!(parent->item->object.flags & SHOWN) &&\n+\t\t\t\t!(parent->item->object.flags & UNINTERESTING))\n+\t\t\treturn 1;\n+\treturn 0;\n+}\n+\n+/* Since intptr_t is C99, we do not use it here */\n+static void mark_object(struct object *object)\n+{\n+\tlast_idnum++;\n+\tadd_decoration(&idnums, object, (void *)last_idnum);\n+}\n+\n+static int get_object_mark(struct object *object)\n+{\n+\treturn (int)lookup_decoration(&idnums, object);\n+}\n+\n+static void show_progress(void)\n+{\n+\tstatic int counter = 0;\n+\tif (!progress)\n+\t\treturn;\n+\tif ((++counter % progress) == 0)\n+\t\tprintf(\"progress %d objects\\n\", counter);\n+}\n+\n+static void handle_object(const unsigned char *sha1)\n+{\n+\tunsigned long size;\n+\tenum object_type type;\n+\tchar *buf;\n+\tstruct object *object;\n+\n+\tif (is_null_sha1(sha1))\n+\t\treturn;\n+\n+\tobject = parse_object(sha1);\n+\tif (!object)\n+\t\tdie (\"Could not read blob %s\", sha1_to_hex(sha1));\n+\n+\tif (object->flags & SHOWN)\n+\t\treturn;\n+\n+\tbuf = read_sha1_file(sha1, &type, &size);\n+\tif (!buf)\n+\t\tdie (\"Could not read blob %s\", sha1_to_hex(sha1));\n+\n+\tmark_object(object);\n+\n+\tprintf(\"blob\\nmark :%d\\ndata %lu\\n\", last_idnum, size);\n+\tif (fwrite(buf, size, 1, stdout) != 1)\n+\t\tdie (\"Could not write blob %s\", sha1_to_hex(sha1));\n+\tprintf(\"\\n\");\n+\n+\tshow_progress();\n+\n+\tobject->flags |= SHOWN;\n+\tfree(buf);\n+}\n+\n+static void show_filemodify(struct diff_queue_struct *q,\n+\t\tstruct diff_options *options, void *data)\n+{\n+\tint i;\n+\tfor (i = 0; i < q->nr; i++) {\n+\t\tstruct diff_filespec *spec = q->queue[i]->two;\n+\t\tif (is_null_sha1(spec->sha1))\n+\t\t\tprintf(\"D %s\\n\", spec->path);\n+\t\telse {\n+\t\t\tstruct object *object = lookup_object(spec->sha1);\n+\t\t\tprintf(\"M 0%06o :%d %s\\n\", spec->mode,\n+\t\t\t\t\tget_object_mark(object), spec->path);\n+\t\t}\n+\t}\n+}\n+\n+static const char *find_encoding(const char *begin, const char *end)\n+{\n+\tconst char *needle = \"\\nencoding \";\n+\tchar *bol, *eol;\n+\n+\tbol = memmem(begin, end ? end - begin : strlen(begin),\n+\t\tneedle, strlen(needle));\n+\tif (!bol)\n+\t\treturn git_commit_encoding;\n+\tbol += strlen(needle);\n+\teol = strchrnul(bol, '\\n');\n+\t*eol = '\\0';\n+\treturn bol;\n+}\n+\n+static void handle_commit(struct commit *commit, struct rev_info *rev)\n+{\n+\tint saved_output_format = rev->diffopt.output_format;\n+\tconst char *author, *author_end, *committer, *committer_end;\n+\tconst char *encoding, *message;\n+\tchar *reencoded = NULL;\n+\tstruct commit_list *p;\n+\tint i;\n+\n+\trev->diffopt.output_format = DIFF_FORMAT_CALLBACK;\n+\n+\tparse_commit(commit);\n+\tauthor = strstr(commit->buffer, \"\\nauthor \");\n+\tif (!author)\n+\t\tdie (\"Could not find author in commit %s\",\n+\t\t\t\tsha1_to_hex(commit->object.sha1));\n+\tauthor++;\n+\tauthor_end = strchrnul(author, '\\n');\n+\tcommitter = strstr(author_end, \"\\ncommitter \");\n+\tif (!committer)\n+\t\tdie (\"Could not find committer in commit %s\",\n+\t\t\t\tsha1_to_hex(commit->object.sha1));\n+\tcommitter++;\n+\tcommitter_end = strchrnul(committer, '\\n');\n+\tmessage = strstr(committer_end, \"\\n\\n\");\n+\tencoding = find_encoding(committer_end, message);\n+\tif (message)\n+\t\tmessage += 2;\n+\n+\tif (commit->parents) {\n+\t\tparse_commit(commit->parents->item);\n+\t\tdiff_tree_sha1(commit->parents->item->tree->object.sha1,\n+\t\t\t\tcommit->tree->object.sha1, \"\", &rev->diffopt);\n+\t}\n+\telse\n+\t\tdiff_root_tree_sha1(commit->tree->object.sha1,\n+\t\t\t\t\"\", &rev->diffopt);\n+\n+\tfor (i = 0; i < diff_queued_diff.nr; i++)\n+\t\thandle_object(diff_queued_diff.queue[i]->two->sha1);\n+\n+\tmark_object(&commit->object);\n+\tif (!is_encoding_utf8(encoding))\n+\t\treencoded = reencode_string(message, \"UTF-8\", encoding);\n+\tprintf(\"commit %s\\nmark :%d\\n%.*s\\n%.*s\\ndata %u\\n%s\",\n+\t\t(const char *)commit->util, last_idnum,\n+\t\tauthor_end - author, author,\n+\t\tcommitter_end - committer, committer,\n+\t\treencoded ? strlen(reencoded) : message ? strlen(message) : 0,\n+\t\treencoded ? reencoded : message ? message : \"\");\n+\tif (reencoded)\n+\t\tfree(reencoded);\n+\n+\tfor (i = 0, p = commit->parents; p; p = p->next) {\n+\t\tint mark = get_object_mark(&p->item->object);\n+\t\tif (!mark)\n+\t\t\tcontinue;\n+\t\tif (i == 0)\n+\t\t\tprintf(\"from :%d\\n\", mark);\n+\t\telse if (i == 1)\n+\t\t\tprintf(\"merge :%d\", mark);\n+\t\telse\n+\t\t\tprintf(\" :%d\", mark);\n+\t\ti++;\n+\t}\n+\tif (i > 1)\n+\t\tprintf(\"\\n\");\n+\n+\tlog_tree_diff_flush(rev);\n+\trev->diffopt.output_format = saved_output_format;\n+\n+\tprintf(\"\\n\");\n+\n+\tshow_progress();\n+}\n+\n+static void handle_tail(struct object_array *commits, struct rev_info *revs)\n+{\n+\tstruct commit *commit;\n+\twhile (commits->nr) {\n+\t\tcommit = (struct commit *)commits->objects[commits->nr - 1].item;\n+\t\tif (has_unshown_parent(commit))\n+\t\t\treturn;\n+\t\thandle_commit(commit, revs);\n+\t\tcommits->nr--;\n+\t}\n+}\n+\n+static void handle_tag(const char *name, struct tag *tag)\n+{\n+        unsigned long size;\n+        enum object_type type;\n+\tchar *buf;\n+\tconst char *tagger, *tagger_end, *message;\n+\tsize_t message_size = 0;\n+\n+\tbuf = read_sha1_file(tag->object.sha1, &type, &size);\n+\tif (!buf)\n+\t\tdie (\"Could not read tag %s\", sha1_to_hex(tag->object.sha1));\n+\tmessage = memmem(buf, size, \"\\n\\n\", 2);\n+\tif (message) {\n+\t\tmessage += 2;\n+\t\tmessage_size = strlen(message);\n+\t}\n+\ttagger = memmem(buf, message ? message - buf : size, \"\\ntagger \", 8);\n+\tif (!tagger)\n+\t\tdie (\"No tagger for tag %s\", sha1_to_hex(tag->object.sha1));\n+\ttagger++;\n+\ttagger_end = strchrnul(tagger, '\\n');\n+\n+\t/* handle signed tags */\n+\tif (message) {\n+\t\tconst char *signature = strstr(message,\n+\t\t\t\"\\n-----BEGIN PGP SIGNATURE-----\\n\");\n+\t\tif (signature)\n+\t\t\tswitch(signed_tag_mode) {\n+\t\t\tcase ABORT:\n+\t\t\t\tdie (\"Encountered signed tag %s; use \"\n+\t\t\t\t\t\"--signed-tag=<mode> to handle it.\",\n+\t\t\t\t\tsha1_to_hex(tag->object.sha1));\n+\t\t\tcase WARN:\n+\t\t\t\twarning (\"Exporting signed tag %s\",\n+\t\t\t\t\tsha1_to_hex(tag->object.sha1));\n+\t\t\t\t/* fallthru */\n+\t\t\tcase IGNORE:\n+\t\t\t\tbreak;\n+\t\t\tcase STRIP:\n+\t\t\t\tmessage_size = signature + 1 - message;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t}\n+\n+\tif (!prefixcmp(name, \"refs/tags/\"))\n+\t\tname += 10;\n+\tprintf(\"tag %s\\nfrom :%d\\n%.*s\\ndata %d\\n%.*s\\n\",\n+\t\tname, get_object_mark(tag->tagged),\n+\t\ttagger_end - tagger, tagger,\n+\t\tmessage_size, message_size, message ? message : \"\");\n+}\n+\n+static void get_tags_and_duplicates(struct object_array *pending,\n+\t\tstruct path_list *extra_refs)\n+{\n+\tstruct commit *commit;\n+\tstruct tag *tag;\n+\tint i;\n+\n+\tfor (i = 0; i < pending->nr; i++) {\n+\t\tstruct object_array_entry *e = pending->objects + i;\n+\t\tunsigned char sha1[20];\n+\t\tchar *full_name;\n+\n+\t\tif (dwim_ref(e->name, strlen(e->name), sha1, &full_name) != 1)\n+\t\t\tcontinue;\n+\n+\t\tswitch (e->item->type) {\n+\t\tcase OBJ_COMMIT:\n+\t\t\tcommit = (struct commit *)e->item;\n+\t\t\tbreak;\n+\t\tcase OBJ_TAG:\n+\t\t\ttag = (struct tag *)e->item;\n+\t\t\twhile (tag && tag->object.type == OBJ_TAG) {\n+\t\t\t\tpath_list_insert(full_name, extra_refs)->util\n+\t\t\t\t\t= tag;\n+\t\t\t\ttag = (struct tag *)tag->tagged;\n+\t\t\t}\n+\t\t\tif (!tag)\n+\t\t\t\tdie (\"Tag %s points nowhere?\", e->name);\n+\t\t\tswitch(tag->object.type) {\n+\t\t\tcase OBJ_COMMIT:\n+\t\t\t\tcommit = (struct commit *)tag;\n+\t\t\t\tbreak;\n+\t\t\tcase OBJ_BLOB:\n+\t\t\t\thandle_object(tag->object.sha1);\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tdie (\"Unexpected object of type %s\",\n+\t\t\t\t\ttypename(e->item->type));\n+\t\t}\n+\t\tif (commit->util)\n+\t\t\t/* more than one name for the same object */\n+\t\t\tpath_list_insert(full_name, extra_refs)->util = commit;\n+\t\telse\n+\t\t\tcommit->util = full_name;\n+\t}\n+}\n+\n+static void handle_tags_and_duplicates(struct path_list *extra_refs)\n+{\n+\tstruct commit *commit;\n+\tint i;\n+\n+\tfor (i = extra_refs->nr - 1; i >= 0; i--) {\n+\t\tconst char *name = extra_refs->items[i].path;\n+\t\tstruct object *object = extra_refs->items[i].util;\n+\t\tswitch (object->type) {\n+\t\tcase OBJ_TAG:\n+\t\t\thandle_tag(name, (struct tag *)object);\n+\t\t\tbreak;\n+\t\tcase OBJ_COMMIT:\n+\t\t\t/* create refs pointing to already seen commits */\n+\t\t\tcommit = (struct commit *)object;\n+\t\t\tprintf(\"reset %s\\nfrom :%d\\n\\n\", name,\n+\t\t\t\t\tget_object_mark(&commit->object));\n+\t\t\tshow_progress();\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+}\n+\n+int cmd_fast_export(int argc, const char **argv, const char *prefix)\n+{\n+\tstruct rev_info revs;\n+\tstruct object_array commits = { 0, 0, NULL };\n+\tstruct path_list extra_refs = { NULL, 0, 0, 0 };\n+\tstruct commit *commit;\n+\tstruct option options[] = {\n+\t\tOPT_INTEGER(0, \"progress\", &progress,\n+\t\t\t\t\"show progress after <n> objects\"),\n+\t\tOPT_CALLBACK(0, \"signed-tags\", &signed_tag_mode, \"mode\",\n+\t\t\t\t\"select handling of signed tags\",\n+\t\t\t\tparse_opt_signed_tag_mode),\n+\t\tOPT_END()\n+\t};\n+\n+\t/* we handle encodings */\n+\tgit_config(git_default_config);\n+\n+\tinit_revisions(&revs, prefix);\n+\targc = setup_revisions(argc, argv, &revs, NULL);\n+\targc = parse_options(argc, argv, options, fast_export_usage, 0);\n+\tif (argc > 1)\n+\t\tusage_with_options (fast_export_usage, options);\n+\n+\tget_tags_and_duplicates(&revs.pending, &extra_refs);\n+\n+\tprepare_revision_walk(&revs);\n+\trevs.diffopt.format_callback = show_filemodify;\n+\tDIFF_OPT_SET(&revs.diffopt, RECURSIVE);\n+\twhile ((commit = get_revision(&revs))) {\n+\t\tif (has_unshown_parent(commit)) {\n+\t\t\tstruct commit_list *parent = commit->parents;\n+\t\t\tadd_object_array(&commit->object, NULL, &commits);\n+\t\t\tfor (; parent; parent = parent->next)\n+\t\t\t\tif (!parent->item->util)\n+\t\t\t\t\tparent->item->util = commit->util;\n+\t\t}\n+\t\telse {\n+\t\t\thandle_commit(commit, &revs);\n+\t\t\thandle_tail(&commits, &revs);\n+\t\t}\n+\t}\n+\n+\thandle_tags_and_duplicates(&extra_refs);\n+\n+\treturn 0;\n+}\ndiff --git a/builtin.h b/builtin.h\nindex 3055bcc..142ab63 100644\n--- a/builtin.h\n+++ b/builtin.h\n@@ -33,6 +33,7 @@ extern int cmd_diff_files(int argc, const char **argv, const char *prefix);\n extern int cmd_diff_index(int argc, const char **argv, const char *prefix);\n extern int cmd_diff(int argc, const char **argv, const char *prefix);\n extern int cmd_diff_tree(int argc, const char **argv, const char *prefix);\n+extern int cmd_fast_export(int argc, const char **argv, const char *prefix);\n extern int cmd_fetch(int argc, const char **argv, const char *prefix);\n extern int cmd_fetch_pack(int argc, const char **argv, const char *prefix);\n extern int cmd_fetch__tool(int argc, const char **argv, const char *prefix);\ndiff --git a/git.c b/git.c\nindex e48c2c9..db0e7c3 100644\n--- a/git.c\n+++ b/git.c\n@@ -303,6 +303,7 @@ static void handle_internal_command(int argc, const char **argv)\n \t\t{ \"diff-files\", cmd_diff_files },\n \t\t{ \"diff-index\", cmd_diff_index, RUN_SETUP },\n \t\t{ \"diff-tree\", cmd_diff_tree, RUN_SETUP },\n+\t\t{ \"fast-export\", cmd_fast_export, RUN_SETUP },\n \t\t{ \"fetch\", cmd_fetch, RUN_SETUP },\n \t\t{ \"fetch-pack\", cmd_fetch_pack, RUN_SETUP },\n \t\t{ \"fetch--tool\", cmd_fetch__tool, RUN_SETUP },\ndiff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh\nnew file mode 100755\nindex 0000000..59f6996\n--- /dev/null\n+++ b/t/t9301-fast-export.sh\n@@ -0,0 +1,124 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2007 Johannes E. Schindelin\n+#\n+\n+test_description='git-fast-export'\n+. ./test-lib.sh\n+\n+test_expect_success 'setup' '\n+\n+\techo Wohlauf > file &&\n+\tgit add file &&\n+\ttest_tick &&\n+\tgit commit -m initial &&\n+\techo die Luft > file &&\n+\techo geht frisch > file2 &&\n+\tgit add file file2 &&\n+\ttest_tick &&\n+\tgit commit -m second &&\n+\techo und > file2 &&\n+\ttest_tick &&\n+\tgit commit -m third file2 &&\n+\ttest_tick &&\n+\tgit tag rein &&\n+\tgit checkout -b wer HEAD^ &&\n+\techo lange > file2\n+\ttest_tick &&\n+\tgit commit -m sitzt file2 &&\n+\ttest_tick &&\n+\tgit tag -a -m valentin muss &&\n+\tgit merge -s ours master\n+\n+'\n+\n+test_expect_success 'fast-export | fast-import' '\n+\n+\tMASTER=$(git rev-parse --verify master) &&\n+\tREIN=$(git rev-parse --verify rein) &&\n+\tWER=$(git rev-parse --verify wer) &&\n+\tMUSS=$(git rev-parse --verify muss) &&\n+\tmkdir new &&\n+\tgit --git-dir=new/.git init &&\n+\tgit fast-export --all |\n+\t(cd new &&\n+\t git fast-import &&\n+\t test $MASTER = $(git rev-parse --verify refs/heads/master) &&\n+\t test $REIN = $(git rev-parse --verify refs/tags/rein) &&\n+\t test $WER = $(git rev-parse --verify refs/heads/wer) &&\n+\t test $MUSS = $(git rev-parse --verify refs/tags/muss))\n+\n+'\n+\n+test_expect_success 'fast-export master~2..master' '\n+\n+\tgit fast-export master~2..master |\n+\t\tsed \"s/master/partial/\" |\n+\t\t(cd new &&\n+\t\t git fast-import &&\n+\t\t test $MASTER != $(git rev-parse --verify refs/heads/partial) &&\n+\t\t git diff master..partial &&\n+\t\t git diff master^..partial^ &&\n+\t\t ! git rev-parse partial~2)\n+\n+'\n+\n+test_expect_success 'iso-8859-1' '\n+\n+        git config i18n.commitencoding ISO-8859-1 &&\n+        # use author and committer name in ISO-8859-1 to match it.\n+        . ../t3901-8859-1.txt &&\n+        test_tick &&\n+        echo rosten >file &&\n+        git commit -s -m den file &&\n+\tgit fast-export wer^..wer |\n+\t\tsed \"s/wer/i18n/\" |\n+\t\t(cd new &&\n+\t\t git fast-import &&\n+\t\t git cat-file commit i18n | grep \"Áéí óú\")\n+\n+'\n+\n+cat > signed-tag-import << EOF\n+tag sign-your-name\n+from $(git rev-parse HEAD)\n+tagger C O Mitter <committer@example.com> 1112911993 -0700\n+data 210\n+A message for a sign\n+-----BEGIN PGP SIGNATURE-----\n+Version: GnuPG v1.4.5 (GNU/Linux)\n+\n+fakedsignaturefakedsignaturefakedsignaturefakedsignaturfakedsign\n+aturefakedsignaturefake=\n+=/59v\n+-----END PGP SIGNATURE-----\n+EOF\n+\n+test_expect_success 'set up faked signed tag' '\n+\n+\tcat signed-tag-import | git fast-import\n+\n+'\n+\n+test_expect_success 'signed-tags=abort' '\n+\n+\t! git fast-export --signed-tags=abort sign-your-name\n+\n+'\n+\n+test_expect_success 'signed-tags=ignore' '\n+\n+\tgit fast-export --signed-tags=ignore sign-your-name > output &&\n+\tgrep PGP output\n+\n+'\n+\n+test_expect_success 'signed-tags=strip' '\n+\n+\tgit fast-export --signed-tags=strip sign-your-name > output &&\n+\t! grep PGP output\n+\n+'\n+\n+test_done\n+\n-- \n1.5.3.6.1828.gd496\n"},{"id":"60895","messageId":"7vbq9hiz6a.fsf@gitster.siamese.dyndns.org","threadId":"11014","inReplyTo":"Pine.LNX.4.64.0711252236350.4725@wbgn129.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Add 'git fast-export', the sister of 'git fast-import'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-26T01:16:29Z","receivedAt":"2007-11-26T01:16:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> diff --git a/Documentation/git-fast-export.txt b/Documentation/git-fast-export.txt\n> new file mode 100644\n> index 0000000..073ff7f\n> --- /dev/null\n> +++ b/Documentation/git-fast-export.txt\n> ...\n> +DESCRIPTION\n> +-----------\n> +This program dumps the given revisions in a form suitable to be piped\n> +into gitlink:git-fast-import[1].\n> +\n> +You can use it as a human readable bundle replacement (see\n> +gitlink:git-bundle[1]), or as a kind of an interactive\n> +gitlink:git-filter-branch[1].\n> +\n> +\n> +OPTIONS\n> +-------\n> +--progress=<n>::\n> +\tInsert 'progress' statements every <n> objects, to be shown by\n> +\tgitlink:git-fast-import[1] during import.\n> +\n> +--signed-tags=(ignore|warn|strip|abort)::\n> +\tSpecify how to handle signed tags.  Since any transformation\n> +\tafter the export can change the tag names (which can also happen\n> +\twhen excluding revisions) the signatures will not match.\n> ++\n> +When asking to 'abort' (which is the default), this program will die\n> +when encountering a signed tag.  With 'strip', the tags will be made\n> +unsigned, with 'ignore', they will be silently ignored (i.e. not exported)\n> +and with 'warn', they will be exported, but you will see a warning.\n\nI am not sure if abort should be the default.\n\nIf a straight dump-restore is made without rewriting, the result will be\nidentical to the original, right?\n\nThe reason I mention a straight dump-restore is because ...\n\n> +$ git fast-export master~5..master |\n> +\tsed \"s|refs/heads/master|refs/heads/other|\" |\n> +\tgit fast-import\n\n... I find this a quite unrealistic example to assume that the data\nstream does not have some string and convert blindly without parsing.\n\nOn the other hand, we _could_ also have a separate filter that works on\ninput stream for fast-import, but that filter should know what the\nfast-import input stream looks like (a simple sed does not cut it).  \n\nSo unless the future direction is to deprecate filter-branch and replace\nit with such a fast-import based filter in between fast-export and\nfast-import, I think the use of fast-export is to make verbatim copy\nwithout munging the contents, which leads me to think --signed-tag\noption should default to \"export it as-is\".\n\n... which seem to be missing from the available values to the option.\n\n> diff --git a/builtin-fast-export.c b/builtin-fast-export.c\n> new file mode 100755\n> index 0000000..48d0c54\n> --- /dev/null\n> +++ b/builtin-fast-export.c\n> ...\n> +/*\n> + * TODO:\n> + * - tags (--signed-tags=(ignore|warn|strip|abort)\n> + */\n\nThis comment is stale?\n"},{"id":"60929","messageId":"Pine.LNX.4.64.0711261236280.27959@racer.site","threadId":"11014","inReplyTo":"7vbq9hiz6a.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add 'git fast-export', the sister of 'git fast-import'","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-26T12:39:49Z","receivedAt":"2007-11-26T12:39:49Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 25 Nov 2007, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > diff --git a/Documentation/git-fast-export.txt b/Documentation/git-fast-export.txt\n> > new file mode 100644\n> > index 0000000..073ff7f\n> > --- /dev/null\n> > +++ b/Documentation/git-fast-export.txt\n> > ...\n> > +DESCRIPTION\n> > +-----------\n> > +This program dumps the given revisions in a form suitable to be piped\n> > +into gitlink:git-fast-import[1].\n> > +\n> > +You can use it as a human readable bundle replacement (see\n> > +gitlink:git-bundle[1]), or as a kind of an interactive\n> > +gitlink:git-filter-branch[1].\n> > +\n> > +\n> > +OPTIONS\n> > +-------\n> > +--progress=<n>::\n> > +\tInsert 'progress' statements every <n> objects, to be shown by\n> > +\tgitlink:git-fast-import[1] during import.\n> > +\n> > +--signed-tags=(ignore|warn|strip|abort)::\n> > +\tSpecify how to handle signed tags.  Since any transformation\n> > +\tafter the export can change the tag names (which can also happen\n> > +\twhen excluding revisions) the signatures will not match.\n> > ++\n> > +When asking to 'abort' (which is the default), this program will die\n> > +when encountering a signed tag.  With 'strip', the tags will be made\n> > +unsigned, with 'ignore', they will be silently ignored (i.e. not exported)\n> > +and with 'warn', they will be exported, but you will see a warning.\n> \n> I am not sure if abort should be the default.\n\nI tried to be conservative.\n\n> If a straight dump-restore is made without rewriting, the result will be \n> identical to the original, right?\n\nYep.\n\n> The reason I mention a straight dump-restore is because ...\n> \n> > +$ git fast-export master~5..master |\n> > +\tsed \"s|refs/heads/master|refs/heads/other|\" |\n> > +\tgit fast-import\n> \n> ... I find this a quite unrealistic example to assume that the data\n> stream does not have some string and convert blindly without parsing.\n\nThat's what the warning after the example is about.  For quick and dirty \noperations, it is quite adequate.\n\nBesides, I have the feeling that some people are more comfortable dumping \nthe whole repository into a file, editing it, and fast-importing it.  That \nis what I referred to when I said \"think of it as kind of an interactive \nfilter-branch\".\n\n> On the other hand, we _could_ also have a separate filter that works on \n> input stream for fast-import, but that filter should know what the \n> fast-import input stream looks like (a simple sed does not cut it).\n\nI agree that for most serious operations sed is not good enough.\n\n> So unless the future direction is to deprecate filter-branch and replace \n> it with such a fast-import based filter in between fast-export and \n> fast-import, I think the use of fast-export is to make verbatim copy \n> without munging the contents, which leads me to think --signed-tag \n> option should default to \"export it as-is\".\n> \n> ... which seem to be missing from the available values to the option.\n\nYou mean something like \"--signed-tag=warn 2> /dev/null\"?  How about a \n\"--signed-tag=quiet\" mode?\n\n> > diff --git a/builtin-fast-export.c b/builtin-fast-export.c\n> > new file mode 100755\n> > index 0000000..48d0c54\n> > --- /dev/null\n> > +++ b/builtin-fast-export.c\n> > ...\n> > +/*\n> > + * TODO:\n> > + * - tags (--signed-tags=(ignore|warn|strip|abort)\n> > + */\n> \n> This comment is stale?\n\nCorrect.\n\nCiao,\nDscho\n"},{"id":"60950","messageId":"7vsl2sgadf.fsf@gitster.siamese.dyndns.org","threadId":"11014","inReplyTo":"Pine.LNX.4.64.0711261236280.27959@racer.site","subject":"Re: [PATCH] Add 'git fast-export', the sister of 'git fast-import'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-26T17:55:08Z","receivedAt":"2007-11-26T17:55:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On Sun, 25 Nov 2007, Junio C Hamano wrote:\n>\n>> I am not sure if abort should be the default.\n>\n> I tried to be conservative.\n>\n>> If a straight dump-restore is made without rewriting, the result will be \n>> identical to the original, right?\n>\n> Yep.\n> ...\n> I agree that for most serious operations sed is not good enough.\n\nMy comment was more about the perception from a new user (not a \"new git\nuser\", but a \"new fast-export and fast-import user\").\n\nWhen you see a command pair foo-export and foo-import, and it is\nadvertised that you can pipe them together, a new user would first try a\nstraight dump-restore, and would see the warning even though he did not\ndo any editing on the stream.\n\n\tHuh?  Why does a tag signature become invalid because of merely\n\texporting and then importing?  What is this warning about?\n\nYou would explain \"yeah in your trial run you did not edit but the\ncommand pair is to allow you editing the contents in between, and if you\ndo that, the object names might change.\".\n\nIf the default were \"straight copy\", then the user will not get an\ninvalid signature on his trial run, but will get an invalid signature\nwhen he rewrites the object stream.  You would get a message on the list\nlike this:\n\n\tHello, I tried fast-export piped to fast-import so that I can\n\trewrite my repository, but I am getting invalid signature on\n\tsigned tags.  It does not seem to happen if I do not edit but\n\tjust use the fast-export output without modification.  What am I\n\tdoing wrong?\n\nAnd that is the time the explanation first becomes useful.  IOW, you are\nwarning at the wrong place.  \"It may or may not corrupt the signature, I\ndo not know.  Because it depends on what you are going to do with my\noutput, I cannot know.  I am warning you anyway to cover my backside\".\n\nI am wondering if fast-import input syntax can be extended to allow\nchecking inconsistencies.  A command to import a tag could take an\nadditional object name and tell it to warn if the name of the tagged\nobject (the one sent with \"from:%d\\n\" part) is different from that\nobject name.  At that point, you know the object was rewritten and the\nsignature is invalid, and the choice of warning, stripping or aborting\nbecomes a useful thing to have.\n"},{"id":"61022","messageId":"20071127020842.GN14735@spearce.org","threadId":"11014","inReplyTo":"Pine.LNX.4.64.0711252236350.4725@wbgn129.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Add 'git fast-export', the sister of 'git fast-import'","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-11-27T02:08:43Z","receivedAt":"2007-11-27T02:08:43Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> This program dumps (parts of) a git repository in the format that\n> fast-import understands.\n...\n> +-------------------------------------------------------------------\n> +$ git fast-export --all | (cd /empty/repository && git fast-import)\n> +-------------------------------------------------------------------\n> +\n> +This will export the whole repository and import it into the existing\n> +empty repository.  Except for reencoding commits that are not in\n> +UTF-8, it would be a one-to-one mirror.\n\nWTF?\n\nWhy are you reencoding the commits on output in fast-export?\nWhy aren't you dumping them raw to the stream?  fast-import takes\nthem raw.  Oh, it doesn't have a way to set the encoding header.\nDOH.\n\nI think this should be prefixed by fast-import patch to teach it\nsomething like \"encoding N\" as a subcommand of commit, so that you\ncan feed data in a non UTF-8 encoding and get it to include the\nproper encoding header in the commit object it creates.  That way\na pipeline like the above really does create a duplicate repository,\nwith the same commit SHA-1s, even if the commits weren't in UTF-8.\n\n-- \nShawn.\n"},{"id":"61053","messageId":"Pine.LNX.4.64.0711271127440.27959@racer.site","threadId":"11014","inReplyTo":"20071127020842.GN14735@spearce.org","subject":"Re: [PATCH] Add 'git fast-export', the sister of 'git fast-import'","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-27T11:31:44Z","receivedAt":"2007-11-27T11:31:44Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 26 Nov 2007, Shawn O. Pearce wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> > This program dumps (parts of) a git repository in the format that\n> > fast-import understands.\n> ...\n> > +-------------------------------------------------------------------\n> > +$ git fast-export --all | (cd /empty/repository && git fast-import)\n> > +-------------------------------------------------------------------\n> > +\n> > +This will export the whole repository and import it into the existing\n> > +empty repository.  Except for reencoding commits that are not in\n> > +UTF-8, it would be a one-to-one mirror.\n> \n> WTF?\n> \n> Why are you reencoding the commits on output in fast-export? Why aren't \n> you dumping them raw to the stream?  fast-import takes them raw.  Oh, it \n> doesn't have a way to set the encoding header. DOH.\n\nNot only that... FTFD:\n\n~ Commit messages are free-form and are not interpreted by Git.  \n~ Currently they must be encoded in UTF-8, as fast-import does not permit \n~ other encodings to be specified.\n\nSo the documentation stated very much that I _had_ to do it that way.\n\n> I think this should be prefixed by fast-import patch to teach it \n> something like \"encoding N\" as a subcommand of commit, so that you can \n> feed data in a non UTF-8 encoding and get it to include the proper \n> encoding header in the commit object it creates.  That way a pipeline \n> like the above really does create a duplicate repository, with the same \n> commit SHA-1s, even if the commits weren't in UTF-8.\n\nIMHO it's not worth that hassle.  People who want to use fast-import \nusually want something fast which works, and not bother with specifying \nencodings.\n\nFurther, if you go down that road, some people will want to be able to say \n\"that commit is KOI-8, this one is UTF-8, and the third is encoded in \npre-Christian Tibetan runes.\"\n\nBut maybe I am wrong.\n\nCiao,\nDscho\n"},{"id":"61059","messageId":"Pine.LNX.4.64.0711271212360.27959@racer.site","threadId":"11014","inReplyTo":"7vsl2sgadf.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add 'git fast-export', the sister of 'git fast-import'","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-27T12:14:07Z","receivedAt":"2007-11-27T12:14:07Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\n[Shawn Cc'ed, since it affects fast-import]\n\nOn Mon, 26 Nov 2007, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > On Sun, 25 Nov 2007, Junio C Hamano wrote:\n> >\n> >> I am not sure if abort should be the default.\n> >\n> > I tried to be conservative.\n> >\n> >> If a straight dump-restore is made without rewriting, the result will \n> >> be identical to the original, right?\n> >\n> > Yep.\n> > ...\n> > I agree that for most serious operations sed is not good enough.\n> \n> My comment was more about the perception from a new user (not a \"new git\n> user\", but a \"new fast-export and fast-import user\").\n> \n> When you see a command pair foo-export and foo-import, and it is\n> advertised that you can pipe them together, a new user would first try a\n> straight dump-restore, and would see the warning even though he did not\n> do any editing on the stream.\n> \n> \tHuh?  Why does a tag signature become invalid because of merely\n> \texporting and then importing?  What is this warning about?\n\nOkay, I did not see that.\n\n> You would explain \"yeah in your trial run you did not edit but the\n> command pair is to allow you editing the contents in between, and if you\n> do that, the object names might change.\".\n> \n> If the default were \"straight copy\", then the user will not get an\n> invalid signature on his trial run, but will get an invalid signature\n> when he rewrites the object stream.  You would get a message on the list\n> like this:\n> \n> \tHello, I tried fast-export piped to fast-import so that I can\n> \trewrite my repository, but I am getting invalid signature on\n> \tsigned tags.  It does not seem to happen if I do not edit but\n> \tjust use the fast-export output without modification.  What am I\n> \tdoing wrong?\n> \n> And that is the time the explanation first becomes useful.  IOW, you are\n> warning at the wrong place.  \"It may or may not corrupt the signature, I\n> do not know.  Because it depends on what you are going to do with my\n> output, I cannot know.  I am warning you anyway to cover my backside\".\n> \n> I am wondering if fast-import input syntax can be extended to allow\n> checking inconsistencies.  A command to import a tag could take an\n> additional object name and tell it to warn if the name of the tagged\n> object (the one sent with \"from:%d\\n\" part) is different from that\n> object name.  At that point, you know the object was rewritten and the\n> signature is invalid, and the choice of warning, stripping or aborting\n> becomes a useful thing to have.\n\nWhy not check by default?  Whenever there is a tag message containing the \nmagic BEGIN line, it should check and at least warn if it does not \nmatch...\n\nCiao,\nDscho\n"},{"id":"61136","messageId":"fii9ta$b2j$1@ger.gmane.org","threadId":"11014","inReplyTo":"Pine.LNX.4.64.0711271127440.27959@racer.site","subject":"Re: [PATCH] Add 'git fast-export', the sister of 'git fast-import'","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-11-27T23:40:30Z","receivedAt":"2007-11-27T23:40:30Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Johannes Schindelin wrote:\n\n> On Mon, 26 Nov 2007, Shawn O. Pearce wrote:\n\n>> I think this should be prefixed by fast-import patch to teach it \n>> something like \"encoding N\" as a subcommand of commit, so that you can \n>> feed data in a non UTF-8 encoding and get it to include the proper \n>> encoding header in the commit object it creates.  That way a pipeline \n>> like the above really does create a duplicate repository, with the same \n>> commit SHA-1s, even if the commits weren't in UTF-8.\n> \n> IMHO it's not worth that hassle.  People who want to use fast-import \n> usually want something fast which works, and not bother with specifying \n> encodings.\n\nWell, when I am converting some repository which uses legacy encoding\n(not utf-8), I'd like to use this git feature of specifying encoding;\nactually, to be generic, it could be any header which would be added to\nall created commit objects.\n\nYes, I could reencode commit messages...\n\n\nP.S. One nice use of proposed (at one time) 'note' header would be to\nsave revision identifier from the version control system you import\n(CVS revision number, Subversion sequential revision number, etc.).\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"61163","messageId":"Pine.LNX.4.64.0711281221090.27959@racer.site","threadId":"11014","inReplyTo":"fii9ta$b2j$1@ger.gmane.org","subject":"Re: [PATCH] Add 'git fast-export', the sister of 'git fast-import'","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-28T12:22:52Z","receivedAt":"2007-11-28T12:22:52Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 28 Nov 2007, Jakub Narebski wrote:\n\n> Johannes Schindelin wrote:\n> \n> > On Mon, 26 Nov 2007, Shawn O. Pearce wrote:\n> \n> >> I think this should be prefixed by fast-import patch to teach it \n> >> something like \"encoding N\" as a subcommand of commit, so that you \n> >> can feed data in a non UTF-8 encoding and get it to include the \n> >> proper encoding header in the commit object it creates.  That way a \n> >> pipeline like the above really does create a duplicate repository, \n> >> with the same commit SHA-1s, even if the commits weren't in UTF-8.\n> > \n> > IMHO it's not worth that hassle.  People who want to use fast-import \n> > usually want something fast which works, and not bother with \n> > specifying encodings.\n> \n> Well, when I am converting some repository which uses legacy encoding \n> (not utf-8), I'd like to use this git feature of specifying encoding; \n> actually, to be generic, it could be any header which would be added to \n> all created commit objects.\n> \n> Yes, I could reencode commit messages...\n\nRight.\n\n> P.S. One nice use of proposed (at one time) 'note' header would be to \n> save revision identifier from the version control system you import (CVS \n> revision number, Subversion sequential revision number, etc.).\n\nWhy not put it into the commit message?  It is not information that git \nuses, so it does not belong into the commit header IMO.  (IIRC I made the \nsame point already at the time 'note' was discussed.)\n\nCiao,\nDscho\n"},{"id":"61175","messageId":"200711281356.06333.jnareb@gmail.com","threadId":"11014","inReplyTo":"Pine.LNX.4.64.0711281221090.27959@racer.site","subject":"Re: [PATCH] Add 'git fast-export', the sister of 'git fast-import'","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-11-28T12:56:05Z","receivedAt":"2007-11-28T12:56:05Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Johannes Schindelin wrote:\n> On Wed, 28 Nov 2007, Jakub Narebski wrote:\n \n>> Yes, I could reencode commit messages...\n> \n> Right.\n> \n>> P.S. One nice use of proposed (at one time) 'note' header would be to \n>> save revision identifier from the version control system you import (CVS \n>> revision number, Subversion sequential revision number, etc.).\n> \n> Why not put it into the commit message?  It is not information that git \n> uses, so it does not belong into the commit header IMO.  (IIRC I made the \n> same point already at the time 'note' was discussed.)\n\nThere are no problems if communication is only in one direction,\ni.e. if it is only import to git repository. If communication is\ntwo-directional, for example importing CVS repository into git\nand using git-cvsserver, or using Subversion repository with the\nhelp of git-svn, you would want commit messages preserved exactly.\nThis includes not adding information about original revision id\nto commit message, and not recoding commit message to other encoding.\n\nJust a thought...\n\n-- \nJakub Narebski\nPoland\n"}]}