{"thread":{"id":"16428","subject":"git fast-export problem with tags","startedAt":"2008-11-22T02:29:13Z","lastAt":"2008-11-24T01:07:09Z","messageCount":6,"participants":["Miklos Vajna","Johannes Schindelin","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"96361","messageId":"20081122022913.GC4746@genesis.frugalware.org","threadId":"16428","inReplyTo":null,"subject":"git fast-export problem with tags","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-11-22T02:29:13Z","receivedAt":"2008-11-22T02:29:13Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Hi Johannes,\n\nIt seems in some cases the tag messages of annotated tags are not\nexported. Here is a reproducer:\n\ngit init\necho a > file\ngit add file\ngit commit -m i\ngit tag -a -m \"one dot zero\" 1.0\n\nNow the output of 'git fast-export --all' does not contain the \"one dot\nzero\" message.\n\nBut if you go a bit futher and make master point to a commit different\nto the tag:\n\necho b > file\ngit add file\ngit commit -m b\n\nthen the output of 'git fast-export --all' clearly has it.\n\nIs this a bug or have I missed something? ;-)\n\nThanks.\n"},{"id":"96366","messageId":"1227378168-14992-1-git-send-email-vmiklos@frugalware.org","threadId":"16428","inReplyTo":"20081122022913.GC4746@genesis.frugalware.org","subject":"[PATCH] Add new testcase to show fast-export does not always exports all tags","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-11-22T18:22:48Z","receivedAt":"2008-11-22T18:22:48Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n\nHere is a testcase for the bug I mentioned.\n\n t/t9301-fast-export.sh |   11 +++++++++++\n 1 files changed, 11 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh\nindex 6ddd7c1..078832f 100755\n--- a/t/t9301-fast-export.sh\n+++ b/t/t9301-fast-export.sh\n@@ -231,4 +231,15 @@ test_expect_success 'fast-export -C -C | fast-import' '\n \n '\n \n+test_expect_failure 'fast-export | fast-import when master is tagged' '\n+\n+\tgit tag -m msg last &&\n+\trm -rf new &&\n+\tmkdir new &&\n+\tgit --git-dir=new/.git init &&\n+\tgit fast-export -C -C --signed-tags=strip --all > output &&\n+\ttest $(grep -c \"^tag\" output) = 3\n+\n+'\n+\n test_done\n-- \n1.6.0.4.770.gf38d.dirty\n"},{"id":"96379","messageId":"alpine.DEB.1.00.0811231254580.30769@pacific.mpi-cbg.de","threadId":"16428","inReplyTo":"1227378168-14992-1-git-send-email-vmiklos@frugalware.org","subject":"[PATCH 1/2] Simplify and fix t9301","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-11-23T11:55:18Z","receivedAt":"2008-11-23T11:55:18Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nThe recent addition to the test to show the tag related breakage was\nnot minimal.\n\nFurther, it tested for the string \"tag\" at the start of the lines,\nwhich matches, \"tagger\", too.  Test for \"tag \" instead.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n\tI'll have no problem if this is squashed into Miklos' patch.\n\n t/t9301-fast-export.sh |    5 +----\n 1 files changed, 1 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh\nindex 078832f..9af50b5 100755\n--- a/t/t9301-fast-export.sh\n+++ b/t/t9301-fast-export.sh\n@@ -234,11 +234,8 @@ test_expect_success 'fast-export -C -C | fast-import' '\n test_expect_failure 'fast-export | fast-import when master is tagged' '\n \n \tgit tag -m msg last &&\n-\trm -rf new &&\n-\tmkdir new &&\n-\tgit --git-dir=new/.git init &&\n \tgit fast-export -C -C --signed-tags=strip --all > output &&\n-\ttest $(grep -c \"^tag\" output) = 3\n+\ttest $(grep -c \"^tag \" output) = 3\n \n '\n \n-- \n1.6.0.2.749.g0cc32\n"},{"id":"96380","messageId":"alpine.DEB.1.00.0811231255380.30769@pacific.mpi-cbg.de","threadId":"16428","inReplyTo":"alpine.DEB.1.00.0811231254580.30769@pacific.mpi-cbg.de","subject":"[BUGFIX PATCH 2/2] fast-export: use an unsorted string list for extra_refs","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-11-23T11:55:54Z","receivedAt":"2008-11-23T11:55:54Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nThe list extra_refs contains tags and the objects referenced by them,\nso that they can be handled at the end.  When a tag references a\ncommit, that commit is added to the list using the same name.\n\nAlso, the function handle_tags_and_duplicates() relies on the order\nthe items were added to extra_refs, so clearly we do not want to\nuse a sorted list here.\n\nNoticed by Miklos Vajna.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n\tMy bad.  Sorry.\n\n builtin-fast-export.c  |    4 ++--\n t/t9301-fast-export.sh |    2 +-\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin-fast-export.c b/builtin-fast-export.c\nindex 7c93eb8..7d5d57a 100644\n--- a/builtin-fast-export.c\n+++ b/builtin-fast-export.c\n@@ -354,7 +354,7 @@ static void get_tags_and_duplicates(struct object_array *pending,\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\tstring_list_insert(full_name, extra_refs)->util = tag;\n+\t\t\t\tstring_list_append(full_name, extra_refs)->util = tag;\n \t\t\t\ttag = (struct tag *)tag->tagged;\n \t\t\t}\n \t\t\tif (!tag)\n@@ -374,7 +374,7 @@ static void get_tags_and_duplicates(struct object_array *pending,\n \t\t}\n \t\tif (commit->util)\n \t\t\t/* more than one name for the same object */\n-\t\t\tstring_list_insert(full_name, extra_refs)->util = commit;\n+\t\t\tstring_list_append(full_name, extra_refs)->util = commit;\n \t\telse\n \t\t\tcommit->util = full_name;\n \t}\ndiff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh\nindex 9af50b5..2057435 100755\n--- a/t/t9301-fast-export.sh\n+++ b/t/t9301-fast-export.sh\n@@ -231,7 +231,7 @@ test_expect_success 'fast-export -C -C | fast-import' '\n \n '\n \n-test_expect_failure 'fast-export | fast-import when master is tagged' '\n+test_expect_success 'fast-export | fast-import when master is tagged' '\n \n \tgit tag -m msg last &&\n \tgit fast-export -C -C --signed-tags=strip --all > output &&\n-- \n1.6.0.2.749.g0cc32\n"},{"id":"96382","messageId":"20081123180353.GM4746@genesis.frugalware.org","threadId":"16428","inReplyTo":"alpine.DEB.1.00.0811231255380.30769@pacific.mpi-cbg.de","subject":"Re: [BUGFIX PATCH 2/2] fast-export: use an unsorted string list for extra_refs","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-11-23T18:03:53Z","receivedAt":"2008-11-23T18:03:53Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Sun, Nov 23, 2008 at 12:55:54PM +0100, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> \n> The list extra_refs contains tags and the objects referenced by them,\n> so that they can be handled at the end.  When a tag references a\n> commit, that commit is added to the list using the same name.\n> \n> Also, the function handle_tags_and_duplicates() relies on the order\n> the items were added to extra_refs, so clearly we do not want to\n> use a sorted list here.\n\nTested-by: Miklos Vajna <vmiklos@frugalware.org>\n\nThanks!\n"},{"id":"96393","messageId":"7vwseund8i.fsf@gitster.siamese.dyndns.org","threadId":"16428","inReplyTo":"20081123180353.GM4746@genesis.frugalware.org","subject":"Re: [BUGFIX PATCH 2/2] fast-export: use an unsorted string list for extra_refs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-11-24T01:07:09Z","receivedAt":"2008-11-24T01:07:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks both; I do not have time to actually double-check and apply for the\nnext 36 hours or so, though.\n"}]}