{"thread":{"id":"18488","subject":"[PATCH 1/4] test-suite: adding a test for fast-export with tag variants","startedAt":"2009-03-23T12:53:06Z","lastAt":"2009-03-30T02:50:37Z","messageCount":8,"participants":["Erik Faye-Lund","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"109051","messageId":"1237812789-1360-1-git-send-email-kusmabite@gmail.com","threadId":"18488","inReplyTo":null,"subject":"[PATCH 1/4] test-suite: adding a test for fast-export with tag variants","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2009-03-23T12:53:06Z","receivedAt":"2009-03-23T12:53:06Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"The first two new tests are crashing, so I'm adding them commented out as they\nexit with unpredictable return-codes.\n\nSigned-off-by: Erik Faye-Lund <kusmabite@gmail.com>\n---\n t/t9301-fast-export.sh |   14 +++++++++++++-\n 1 files changed, 13 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh\nindex 86c3760..db4b0b3 100755\n--- a/t/t9301-fast-export.sh\n+++ b/t/t9301-fast-export.sh\n@@ -28,7 +28,12 @@ test_expect_success 'setup' '\n \tgit commit -m sitzt file2 &&\n \ttest_tick &&\n \tgit tag -a -m valentin muss &&\n-\tgit merge -s ours master\n+\tgit merge -s ours master &&\n+\tHEAD_TREE=`git show -s --pretty=raw HEAD | grep tree | sed \"s/tree //\"` &&\n+\tgit tag    tree_tag        -m \"tagging a tree\" $HEAD_TREE &&\n+\tgit tag -a tree_tag-obj    -m \"tagging a tree\" $HEAD_TREE &&\n+\tgit tag    tag-obj_tag     -m \"tagging a tag\" tree_tag-obj &&\n+\tgit tag -a tag-obj_tag-obj -m \"tagging a tag\" tree_tag-obj\n \n '\n \n@@ -259,4 +264,11 @@ test_expect_success 'cope with tagger-less tags' '\n \n '\n \n+# NEEDSWORK: not just check return status, but validate the output\n+# two tests commented out due to crash and thus unreliable return code\n+#test_expect_success 'tree_tag'        'git fast-export tree_tag'\n+#test_expect_success 'tree_tag-obj'    'git fast-export tree_tag-obj'\n+test_expect_failure 'tag-obj_tag'     'git fast-export tag-obj_tag'\n+test_expect_failure 'tag-obj_tag-obj' 'git fast-export tag-obj_tag-obj'\n+\n test_done\n-- \n1.6.2.1.225.g9a4a0.dirty\n"},{"id":"109052","messageId":"1237812789-1360-2-git-send-email-kusmabite@gmail.com","threadId":"18488","inReplyTo":"1237812789-1360-1-git-send-email-kusmabite@gmail.com","subject":"[PATCH 2/4] builtin-fast-export.c: turn error into warning","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2009-03-23T12:53:07Z","receivedAt":"2009-03-23T12:53:07Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"fast-import doesn't have a syntax to support tree-objects (and some other\nobject-types), so fast-export shouldn't handle them. However, aborting the\noperation is a bit drastic. This patch turns the error into a warning instead.\n\nSigned-off-by: Erik Faye-Lund <kusmabite@gmail.com>\n---\n builtin-fast-export.c |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin-fast-export.c b/builtin-fast-export.c\nindex fdf4ae9..02bad1f 100644\n--- a/builtin-fast-export.c\n+++ b/builtin-fast-export.c\n@@ -378,8 +378,10 @@ static void get_tags_and_duplicates(struct object_array *pending,\n \t\t\t}\n \t\t\tbreak;\n \t\tdefault:\n-\t\t\tdie (\"Unexpected object of type %s\",\n-\t\t\t     typename(e->item->type));\n+\t\t\twarning(\"%s: Unexpected object of type %s, skipping.\",\n+\t\t\t        e->name,\n+\t\t\t        typename(e->item->type));\n+\t\t\tcontinue;\n \t\t}\n \t\tif (commit->util)\n \t\t\t/* more than one name for the same object */\n-- \n1.6.2.1.225.g9a4a0.dirty\n"},{"id":"109053","messageId":"1237812789-1360-3-git-send-email-kusmabite@gmail.com","threadId":"18488","inReplyTo":"1237812789-1360-2-git-send-email-kusmabite@gmail.com","subject":"[PATCH 3/4] builtin-fast-export.c: fix crash on tagged trees","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2009-03-23T12:53:08Z","receivedAt":"2009-03-23T12:53:08Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"If a tag object points to a tree (or another unhandled type), the commit-\npointer is left uninitialized and later dereferenced. This patch adds a default\ncase to the switch that issues a warning and skips the object.\n\nSigned-off-by: Erik Faye-Lund <kusmabite@gmail.com>\n---\n builtin-fast-export.c  |    4 ++++\n t/t9301-fast-export.sh |    5 ++---\n 2 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin-fast-export.c b/builtin-fast-export.c\nindex 02bad1f..e716eee 100644\n--- a/builtin-fast-export.c\n+++ b/builtin-fast-export.c\n@@ -375,6 +375,10 @@ static void get_tags_and_duplicates(struct object_array *pending,\n \t\t\tcase OBJ_BLOB:\n \t\t\t\thandle_object(tag->object.sha1);\n \t\t\t\tcontinue;\n+\t\t\tdefault:\n+\t\t\t\twarning(\"Tag points to object of unexpected type %s, skipping.\",\n+\t\t\t\t        typename(tag->object.type));\n+\t\t\t\tcontinue;\n \t\t\t}\n \t\t\tbreak;\n \t\tdefault:\ndiff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh\nindex db4b0b3..79ca832 100755\n--- a/t/t9301-fast-export.sh\n+++ b/t/t9301-fast-export.sh\n@@ -265,9 +265,8 @@ test_expect_success 'cope with tagger-less tags' '\n '\n \n # NEEDSWORK: not just check return status, but validate the output\n-# two tests commented out due to crash and thus unreliable return code\n-#test_expect_success 'tree_tag'        'git fast-export tree_tag'\n-#test_expect_success 'tree_tag-obj'    'git fast-export tree_tag-obj'\n+test_expect_success 'tree_tag'        'git fast-export tree_tag'\n+test_expect_success 'tree_tag-obj'    'git fast-export tree_tag-obj'\n test_expect_failure 'tag-obj_tag'     'git fast-export tag-obj_tag'\n test_expect_failure 'tag-obj_tag-obj' 'git fast-export tag-obj_tag-obj'\n \n-- \n1.6.2.1.225.g9a4a0.dirty\n"},{"id":"109054","messageId":"1237812789-1360-4-git-send-email-kusmabite@gmail.com","threadId":"18488","inReplyTo":"1237812789-1360-3-git-send-email-kusmabite@gmail.com","subject":"[PATCH 4/4] builtin-fast-export.c: handle nested tags","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2009-03-23T12:53:09Z","receivedAt":"2009-03-23T12:53:09Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"When tags that points to tags are passed to fast-export, an error saying\n\"Tag [TAGNAME] points nowhere?\". This fix calls parse_object() on the object\nbefore referencing it's tag, to ensure the tag-info is fully initialized. In\naddition, it inserts a comment to point out where nested tags are handled. This\nis consistent with the comment for signed tags.\n\nSigned-off-by: Erik Faye-Lund <kusmabite@gmail.com>\n---\n builtin-fast-export.c  |    5 ++++-\n t/t9301-fast-export.sh |    4 ++--\n 2 files changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin-fast-export.c b/builtin-fast-export.c\nindex e716eee..8083c5f 100644\n--- a/builtin-fast-export.c\n+++ b/builtin-fast-export.c\n@@ -362,7 +362,10 @@ static void get_tags_and_duplicates(struct object_array *pending,\n \t\t\tbreak;\n \t\tcase OBJ_TAG:\n \t\t\ttag = (struct tag *)e->item;\n+\n+\t\t\t/* handle nested tags */\n \t\t\twhile (tag && tag->object.type == OBJ_TAG) {\n+\t\t\t\tparse_object(tag->object.sha1);\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@@ -375,7 +378,7 @@ static void get_tags_and_duplicates(struct object_array *pending,\n \t\t\tcase OBJ_BLOB:\n \t\t\t\thandle_object(tag->object.sha1);\n \t\t\t\tcontinue;\n-\t\t\tdefault:\n+\t\t\tdefault: /* OBJ_TAG (nested tags) is already handled */\n \t\t\t\twarning(\"Tag points to object of unexpected type %s, skipping.\",\n \t\t\t\t        typename(tag->object.type));\n \t\t\t\tcontinue;\ndiff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh\nindex 79ca832..7e94893 100755\n--- a/t/t9301-fast-export.sh\n+++ b/t/t9301-fast-export.sh\n@@ -267,7 +267,7 @@ test_expect_success 'cope with tagger-less tags' '\n # NEEDSWORK: not just check return status, but validate the output\n test_expect_success 'tree_tag'        'git fast-export tree_tag'\n test_expect_success 'tree_tag-obj'    'git fast-export tree_tag-obj'\n-test_expect_failure 'tag-obj_tag'     'git fast-export tag-obj_tag'\n-test_expect_failure 'tag-obj_tag-obj' 'git fast-export tag-obj_tag-obj'\n+test_expect_success 'tag-obj_tag'     'git fast-export tag-obj_tag'\n+test_expect_success 'tag-obj_tag-obj' 'git fast-export tag-obj_tag-obj'\n \n test_done\n-- \n1.6.2.1.225.g9a4a0.dirty\n"},{"id":"109783","messageId":"40aa078e0903291305p28ec2ae8xf0cb465e593af0b0@mail.gmail.com","threadId":"18488","inReplyTo":"1237812789-1360-1-git-send-email-kusmabite@gmail.com","subject":"Re: [PATCH 1/4] test-suite: adding a test for fast-export with tag variants","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@googlemail.com","sentAt":"2009-03-29T20:05:36Z","receivedAt":"2009-03-29T20:05:36Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"OK, I see now that the previous patch-series has been merged to \"pu\".\nIs there a reason why this updated patch-series hasn't superseded it?\nDid I do something wrong when I resubmitted it? And what do I need to\ndo to get these patches going forward from there?\n\nOn Mon, Mar 23, 2009 at 2:53 PM, Erik Faye-Lund <kusmabite@gmail.com> wrote:\n> The first two new tests are crashing, so I'm adding them commented out as they\n> exit with unpredictable return-codes.\n>\n> Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>\n> ---\n>  t/t9301-fast-export.sh |   14 +++++++++++++-\n>  1 files changed, 13 insertions(+), 1 deletions(-)\n>\n> diff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh\n> index 86c3760..db4b0b3 100755\n> --- a/t/t9301-fast-export.sh\n> +++ b/t/t9301-fast-export.sh\n> @@ -28,7 +28,12 @@ test_expect_success 'setup' '\n>        git commit -m sitzt file2 &&\n>        test_tick &&\n>        git tag -a -m valentin muss &&\n> -       git merge -s ours master\n> +       git merge -s ours master &&\n> +       HEAD_TREE=`git show -s --pretty=raw HEAD | grep tree | sed \"s/tree //\"` &&\n> +       git tag    tree_tag        -m \"tagging a tree\" $HEAD_TREE &&\n> +       git tag -a tree_tag-obj    -m \"tagging a tree\" $HEAD_TREE &&\n> +       git tag    tag-obj_tag     -m \"tagging a tag\" tree_tag-obj &&\n> +       git tag -a tag-obj_tag-obj -m \"tagging a tag\" tree_tag-obj\n>\n>  '\n>\n> @@ -259,4 +264,11 @@ test_expect_success 'cope with tagger-less tags' '\n>\n>  '\n>\n> +# NEEDSWORK: not just check return status, but validate the output\n> +# two tests commented out due to crash and thus unreliable return code\n> +#test_expect_success 'tree_tag'        'git fast-export tree_tag'\n> +#test_expect_success 'tree_tag-obj'    'git fast-export tree_tag-obj'\n> +test_expect_failure 'tag-obj_tag'     'git fast-export tag-obj_tag'\n> +test_expect_failure 'tag-obj_tag-obj' 'git fast-export tag-obj_tag-obj'\n> +\n>  test_done\n> --\n> 1.6.2.1.225.g9a4a0.dirty\n>\n>\n\n\n\n-- \nErik \"kusma\" Faye-Lund\nkusmabite@gmail.com\n(+47) 986 59 656\n"},{"id":"109788","messageId":"7vwsa8ow10.fsf@gitster.siamese.dyndns.org","threadId":"18488","inReplyTo":"40aa078e0903291305p28ec2ae8xf0cb465e593af0b0@mail.gmail.com","subject":"Re: [PATCH 1/4] test-suite: adding a test for fast-export with tag variants","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-29T21:32:11Z","receivedAt":"2009-03-29T21:32:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Erik Faye-Lund <kusmabite@googlemail.com> writes:\n\n> OK, I see now that the previous patch-series has been merged to \"pu\".\n> Is there a reason why this updated patch-series hasn't superseded it?\n\nEven if the tested program crashes, it is Ok to test them inside\nexpect_failure, so I'd suggest not commenting the first two out.\n\nBut running the tests with the first patch applied to the same base as\nwhere v1 was applied gives this, which is a more serious issue:\n\n    $ sh t9301-fast-export.sh 2>&1 | tail -n 2\n    * still have 4 known breakage(s)\n    * failed 6 among remaining 15 test(s)\n\nIn other words, the changes to the set-up part seem to break unrelated\ntests.  Why can such an update supersede the previous one?\n"},{"id":"109789","messageId":"40aa078e0903291444m3a29662j3162ed511eee0ac8@mail.gmail.com","threadId":"18488","inReplyTo":"7vwsa8ow10.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 1/4] test-suite: adding a test for fast-export with tag variants","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@googlemail.com","sentAt":"2009-03-29T21:44:10Z","receivedAt":"2009-03-29T21:44:10Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Sun, Mar 29, 2009 at 11:32 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Even if the tested program crashes, it is Ok to test them inside\n> expect_failure, so I'd suggest not commenting the first two out.\n\nOK, the reason why I didn't want to do that is because the test\nappears to succeed on windows when it crashes. But you might not care\ntoo much about that ;)\n\n> But running the tests with the first patch applied to the same base as\n> where v1 was applied gives this, which is a more serious issue:\n>\n>    $ sh t9301-fast-export.sh 2>&1 | tail -n 2\n>    * still have 4 known breakage(s)\n>    * failed 6 among remaining 15 test(s)\n>\n> In other words, the changes to the set-up part seem to break unrelated\n> tests.  Why can such an update supersede the previous one?\n\nThat's weird. I did test it properly before I applied it, and I don't\nrecall having any failures on Linux. On Windows, I get lots of\nfailures with vanilla git.git, and I don't have access to my Linux-box\nright now, so I can't easily verify this until that box comes up\nagain. I did see that another patch (ebeec7d) has made it's way into\nthe test since I submitted it - perhaps these two collided?\n\nBut OK, I'll have a look at it when that box comes up, and see if I\ncan come up with a good patch-series.\n\n-- \nErik \"kusma\" Faye-Lund\nkusmabite@gmail.com\n(+47) 986 59 656\n"},{"id":"109804","messageId":"7vab73pvuq.fsf@gitster.siamese.dyndns.org","threadId":"18488","inReplyTo":"40aa078e0903291444m3a29662j3162ed511eee0ac8@mail.gmail.com","subject":"Re: [PATCH 1/4] test-suite: adding a test for fast-export with tag variants","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-30T02:50:37Z","receivedAt":"2009-03-30T02:50:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Erik Faye-Lund <kusmabite@googlemail.com> writes:\n\n>> But running the tests with the first patch applied to the same base as\n>> where v1 was applied gives this, which is a more serious issue:\n>>\n>>    $ sh t9301-fast-export.sh 2>&1 | tail -n 2\n>>    * still have 4 known breakage(s)\n>>    * failed 6 among remaining 15 test(s)\n>>\n>> In other words, the changes to the set-up part seem to break unrelated\n>> tests.  Why can such an update supersede the previous one?\n>\n> That's weird. I did test it properly before I applied it, and I don't\n> recall having any failures on Linux.\n\nI think it is just the matter of doing something like this instead of your\npatch [PATCH v2 1/4].  Either that, or I think you need to adjust the\nexisting tests that try to export --all and get hit by the fast that you\nadded the tags you already knew the old code had trouble with in the test\nsetup for them.\n\n-- >8 --\nFrom: Erik Faye-Lund <kusmabite@gmail.com>\nDate: Mon, 23 Mar 2009 12:53:06 +0000\nSubject: [PATCH] test-suite: adding a test for fast-export with tag variants\n\nSigned-off-by: Erik Faye-Lund <kusmabite@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t9301-fast-export.sh |   16 ++++++++++++++++\n 1 files changed, 16 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh\nindex 86c3760..2e31f67 100755\n--- a/t/t9301-fast-export.sh\n+++ b/t/t9301-fast-export.sh\n@@ -259,4 +259,20 @@ test_expect_success 'cope with tagger-less tags' '\n \n '\n \n+test_expect_success 'set-up a few more tags for tag export tests' '\n+\tgit checkout -f master &&\n+\tHEAD_TREE=`git show -s --pretty=raw HEAD | grep tree | sed \"s/tree //\"` &&\n+\tgit tag    tree_tag        -m \"tagging a tree\" $HEAD_TREE &&\n+\tgit tag -a tree_tag-obj    -m \"tagging a tree\" $HEAD_TREE &&\n+\tgit tag    tag-obj_tag     -m \"tagging a tag\" tree_tag-obj &&\n+\tgit tag -a tag-obj_tag-obj -m \"tagging a tag\" tree_tag-obj\n+'\n+\n+# NEEDSWORK: not just check return status, but validate the output\n+# two tests commented out due to crash and thus unreliable return code\n+test_expect_failure 'tree_tag'        'git fast-export tree_tag'\n+test_expect_failure 'tree_tag-obj'    'git fast-export tree_tag-obj'\n+test_expect_failure 'tag-obj_tag'     'git fast-export tag-obj_tag'\n+test_expect_failure 'tag-obj_tag-obj' 'git fast-export tag-obj_tag-obj'\n+\n test_done\n-- \n1.6.2.1\n"}]}