{"thread":{"id":"34612","subject":"[PATCH] t8001, t8002: fix \"blame -L :literal\" test on NetBSD","startedAt":"2013-08-05T15:21:17Z","lastAt":"2013-08-05T17:44:48Z","messageCount":3,"participants":["René Scharfe","Eric Sunshine","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"224580","messageId":"51FFC2ED.3080906@web.de","threadId":"34612","inReplyTo":null,"subject":"[PATCH] t8001, t8002: fix \"blame -L :literal\" test on NetBSD","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2013-08-05T15:21:17Z","receivedAt":"2013-08-05T15:21:17Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Sub-test 42 of t8001 and t8002 (\"blame -L :literal\") fails on NetBSD\nwith the following verbose output:\n\n\tgit annotate  -L:main hello.c\n\tAuthor F (expected 4, attributed 3) bad\n\tAuthor G (expected 1, attributed 1) good\n\nThis is not caused by different behaviour of git blame or annotate on\nthat platform, but by different test input, in turn caused by a sed\ncommand that forgets to add a newline on NetBSD.  Here's the diff of the\ncommit that adds \"goodbye\" to hello.c, for Linux:\n\n\t@@ -1,4 +1,5 @@\n\t int main(int argc, const char *argv[])\n\t {\n\t\tputs(\"hello\");\n\t+\t\tputs(\"goodbye\");\n\t }\n\nWe see that it adds an extra TAB, but that's not a problem.  Here's the\nsame on NetBSD:\n\n\t@@ -1,4 +1,4 @@\n\t int main(int argc, const char *argv[])\n\t {\n\t\tputs(\"hello\");\n\t-}\n\t+\t\tputs(\"goodbye\");}\n\nIt also adds an extra TAB, but it is missing the newline character\nafter the semicolon.\n\nThe following patch gets rid of the extra TAB at the beginning, but\nmore importantly adds the missing newline at the end in a (hopefully)\nportable way, mentioned in http://sed.sourceforge.net/sedfaq4.html.\nThe diff becomes this, on both Linux and NetBSD:\n\n\t@@ -1,4 +1,5 @@\n\t int main(int argc, const char *argv[])\n\t {\n\t\tputs(\"hello\");\n\t+\tputs(\"goodbye\");\n\t }\n\nSigned-off-by: Rene Scharfe <l.s.r@web.de>\n---\nThis regression was introduced by 5a9830cb (\"t8001/t8002 (blame):\nadd blame -L :funcname tests\").\n\n t/annotate-tests.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/annotate-tests.sh b/t/annotate-tests.sh\nindex 0bfee00..d4e7f47 100644\n--- a/t/annotate-tests.sh\n+++ b/t/annotate-tests.sh\n@@ -245,8 +245,8 @@ test_expect_success 'setup -L :regex' '\n \tgit commit -m \"hello\" &&\n \n \tmv hello.c hello.orig &&\n-\tsed -e \"/}/i\\\\\n-\tQputs(\\\"goodbye\\\");\" <hello.orig | tr Q \"\\\\t\" >hello.c &&\n+\tsed -e \"/}/ {x; s/$/Qputs(\\\"goodbye\\\");/; G;}\" <hello.orig |\n+\ttr Q \"\\\\t\" >hello.c &&\n \tGIT_AUTHOR_NAME=\"G\" GIT_AUTHOR_EMAIL=\"G@test.git\" \\\n \tgit commit -a -m \"goodbye\" &&\n \n-- \n1.8.1.5\n"},{"id":"224583","messageId":"CAPig+cS4vzA9Kb=YKMYmFkckYwsRmg1AeY9hjAnGSS9MwzXkbQ@mail.gmail.com","threadId":"34612","inReplyTo":"51FFC2ED.3080906@web.de","subject":"Re: [PATCH] t8001, t8002: fix \"blame -L :literal\" test on NetBSD","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-08-05T15:33:54Z","receivedAt":"2013-08-05T15:33:54Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Aug 5, 2013 at 11:21 AM, René Scharfe <l.s.r@web.de> wrote:\n> Sub-test 42 of t8001 and t8002 (\"blame -L :literal\") fails on NetBSD\n> with the following verbose output:\n>\n>         git annotate  -L:main hello.c\n>         Author F (expected 4, attributed 3) bad\n>         Author G (expected 1, attributed 1) good\n>\n> This is not caused by different behaviour of git blame or annotate on\n> that platform, but by different test input, in turn caused by a sed\n> command that forgets to add a newline on NetBSD.  Here's the diff of the\n> commit that adds \"goodbye\" to hello.c, for Linux:\n>\n>         @@ -1,4 +1,5 @@\n>          int main(int argc, const char *argv[])\n>          {\n>                 puts(\"hello\");\n>         +               puts(\"goodbye\");\n>          }\n>\n> We see that it adds an extra TAB,\n\nCurious. On Mac OS X, there is only a single tab.\n\n> but that's not a problem.  Here's the\n> same on NetBSD:\n>\n>         @@ -1,4 +1,4 @@\n>          int main(int argc, const char *argv[])\n>          {\n>                 puts(\"hello\");\n>         -}\n>         +               puts(\"goodbye\");}\n>\n> It also adds an extra TAB, but it is missing the newline character\n> after the semicolon.\n>\n> The following patch gets rid of the extra TAB at the beginning, but\n> more importantly adds the missing newline at the end in a (hopefully)\n> portable way, mentioned in http://sed.sourceforge.net/sedfaq4.html.\n\nTested on Mac OS X. Works correctly.\n\n> The diff becomes this, on both Linux and NetBSD:\n>\n>         @@ -1,4 +1,5 @@\n>          int main(int argc, const char *argv[])\n>          {\n>                 puts(\"hello\");\n>         +       puts(\"goodbye\");\n>          }\n>\n> Signed-off-by: Rene Scharfe <l.s.r@web.de>\n> ---\n> This regression was introduced by 5a9830cb (\"t8001/t8002 (blame):\n> add blame -L :funcname tests\").\n>\n>  t/annotate-tests.sh | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh\n> index 0bfee00..d4e7f47 100644\n> --- a/t/annotate-tests.sh\n> +++ b/t/annotate-tests.sh\n> @@ -245,8 +245,8 @@ test_expect_success 'setup -L :regex' '\n>         git commit -m \"hello\" &&\n>\n>         mv hello.c hello.orig &&\n> -       sed -e \"/}/i\\\\\n> -       Qputs(\\\"goodbye\\\");\" <hello.orig | tr Q \"\\\\t\" >hello.c &&\n> +       sed -e \"/}/ {x; s/$/Qputs(\\\"goodbye\\\");/; G;}\" <hello.orig |\n> +       tr Q \"\\\\t\" >hello.c &&\n\nThanks.\n\nAcked-by: Eric Sunshine <sunshine@sunshineco.com>\n\n>         GIT_AUTHOR_NAME=\"G\" GIT_AUTHOR_EMAIL=\"G@test.git\" \\\n>         git commit -a -m \"goodbye\" &&\n"},{"id":"224608","messageId":"7v8v0gkp67.fsf@alter.siamese.dyndns.org","threadId":"34612","inReplyTo":"51FFC2ED.3080906@web.de","subject":"Re: [PATCH] t8001, t8002: fix \"blame -L :literal\" test on NetBSD","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-05T17:44:48Z","receivedAt":"2013-08-05T17:44:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.\n"}]}