{"thread":{"id":"4564","subject":"[PATCH] Make t8001-annotate and t8002-blame more portable","startedAt":"2006-06-18T20:33:21Z","lastAt":"2006-06-19T19:40:37Z","messageCount":6,"participants":["Dennis Stosberg","Junio C Hamano","Alex Riesen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"22038","messageId":"20060618203321.G2e8b0080@leonov.stosberg.net","threadId":"4564","inReplyTo":null,"subject":"[PATCH] Make t8001-annotate and t8002-blame more portable","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-06-18T20:33:21Z","receivedAt":"2006-06-18T20:33:21Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"These two tests assume that \"sed\" will not modify the final line of a\nstream if it does not end with a newline character.  The assumption is\nnot true at least for FreeBSD and Solaris 9.  FreeBSD's \"sed\" appends\na newline character; \"sed\" in Solaris 9 even removes the incomplete\nfinal line.  This patch makes the test use perl instead.\n\nSigned-off-by: Dennis Stosberg <dennis@stosberg.net>\n---\n t/annotate-tests.sh |    4 +---\n 1 files changed, 1 insertions(+), 3 deletions(-)\n\ndiff --git a/t/annotate-tests.sh b/t/annotate-tests.sh\nindex 114938c..71d0f30 100644\n--- a/t/annotate-tests.sh\n+++ b/t/annotate-tests.sh\n@@ -111,9 +111,7 @@ test_expect_success \\\n \n test_expect_success \\\n     'some edit' \\\n-    'mv file file1 &&\n-     sed -e 1d -e \"5s/3A/99/\" file1 >file &&\n-     rm -f file1 &&\n+    'perl -pi -e \"s/^1A.*\\n$//; s/^3A/99/\" file &&\n     GIT_AUTHOR_NAME=\"D\" git commit -a -m \"edit\"'\n \n test_expect_success \\\n-- \n1.4.0\n"},{"id":"22039","messageId":"7v3be218ri.fsf@assigned-by-dhcp.cox.net","threadId":"4564","inReplyTo":"20060618203321.G2e8b0080@leonov.stosberg.net","subject":"Re: [PATCH] Make t8001-annotate and t8002-blame more portable","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-18T20:58:09Z","receivedAt":"2006-06-18T20:58:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dennis Stosberg <dennis@stosberg.net> writes:\n\n> These two tests assume that \"sed\" will not modify the final line of a\n> stream if it does not end with a newline character.  The assumption is\n> not true at least for FreeBSD and Solaris 9.  FreeBSD's \"sed\" appends\n> a newline character; \"sed\" in Solaris 9 even removes the incomplete\n> final line.\n\nGaaah.\n\n> -    'mv file file1 &&\n> -     sed -e 1d -e \"5s/3A/99/\" file1 >file &&\n> -     rm -f file1 &&\n> +    'perl -pi -e \"s/^1A.*\\n$//; s/^3A/99/\" file &&\n>      GIT_AUTHOR_NAME=\"D\" git commit -a -m \"edit\"'\n\nThe first line in the original is removed while the perl version\nseems to just makes it empty -- ah, you remove the trailing LF\nas well there.  I've never seen this done like this, but OK.\n\nIt would have been more obvious if it were written like this:\n\n\t$_ = \"\" if ($. == 1);\n\nbut probably it is just me.\n\nThanks for the patch.\n"},{"id":"22043","messageId":"20060618220654.G4a2f724@leonov.stosberg.net","threadId":"4564","inReplyTo":"7v3be218ri.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Make t8001-annotate and t8002-blame more portable","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-06-18T22:06:54Z","receivedAt":"2006-06-18T22:06:54Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"Junio C Hamano wrote:\n\n> > +    'perl -pi -e \"s/^1A.*\\n$//; s/^3A/99/\" file &&\n> >      GIT_AUTHOR_NAME=\"D\" git commit -a -m \"edit\"'\n> \n> The first line in the original is removed while the perl version\n> seems to just makes it empty -- ah, you remove the trailing LF\n> as well there.  I've never seen this done like this, but OK.\n> \n> It would have been more obvious if it were written like this:\n> \n> \t$_ = \"\" if ($. == 1);\n> \n> but probably it is just me.\n\nI have no strong preference.  Sometimes I find all those magic perl\nvariables like $. $| $, $\" and so on hard to distinguish without\nlooking in the manual...\n\nRegards,\nDennis \n"},{"id":"22044","messageId":"7virmydrzx.fsf@assigned-by-dhcp.cox.net","threadId":"4564","inReplyTo":"20060618220654.G4a2f724@leonov.stosberg.net","subject":"Re: [PATCH] Make t8001-annotate and t8002-blame more portable","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-06-18T22:21:54Z","receivedAt":"2006-06-18T22:21:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dennis Stosberg <dennis@stosberg.net> writes:\n\n>> It would have been more obvious if it were written like this:\n>> \n>> \t$_ = \"\" if ($. == 1);\n>> \n>> but probably it is just me.\n>\n> I have no strong preference...\n\nNah, don't worry -- I've already applied your version to my\ntree.\n"},{"id":"22066","messageId":"81b0412b0606190935g67581ebucf172acb36e53b02@mail.gmail.com","threadId":"4564","inReplyTo":"7v3be218ri.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Make t8001-annotate and t8002-blame more portable","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2006-06-19T16:35:39Z","receivedAt":"2006-06-19T16:35:39Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 6/18/06, Junio C Hamano <junkio@cox.net> wrote:\n> > +    'perl -pi -e \"s/^1A.*\\n$//; s/^3A/99/\" file &&\n\nactivestate perl again: doesn't work without giving a backup file extension,\nlike this: perl -pi.bak -e ...\n"},{"id":"22071","messageId":"20060619194037.G41ac8efa@leonov.stosberg.net","threadId":"4564","inReplyTo":"81b0412b0606190935g67581ebucf172acb36e53b02@mail.gmail.com","subject":"[PATCH] Fix t8001-annotate and t8002-blame for ActiveState Perl","fromName":"Dennis Stosberg","fromEmail":"dennis@stosberg.net","sentAt":"2006-06-19T19:40:37Z","receivedAt":"2006-06-19T19:40:37Z","isPatch":true,"sender":{"key":"dennis@stosberg.net","avatar":null},"body":"There seems to be at least one implementation of Perl which requires the\nuser to specify an extension for backup files.\n\nReported by Alex Riesen.\n\nSigned-off-by: Dennis Stosberg <dennis@stosberg.net>\n---\n\nWhat system and what version of ActivePerl do you use?  I have just\ntried ActivePerl 5.8.8 on Solaris and it does _not_ force the user\nto make backups.\n\n t/annotate-tests.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/annotate-tests.sh b/t/annotate-tests.sh\nindex c04f0e1..03ed081 100644\n--- a/t/annotate-tests.sh\n+++ b/t/annotate-tests.sh\n@@ -111,7 +111,7 @@ test_expect_success \\\n \n test_expect_success \\\n     'some edit' \\\n-    'perl -pi -e \"s/^1A.*\\n$//; s/^3A/99/\" file &&\n+    'perl -p -i.orig -e \"s/^1A.*\\n$//; s/^3A/99/\" file &&\n     GIT_AUTHOR_NAME=\"D\" git commit -a -m \"edit\"'\n \n test_expect_success \\\n-- \n1.4.0\n"}]}