{"thread":{"id":"13733","subject":"[PATCH] Add test cases for git-am","startedAt":"2008-05-30T14:04:47Z","lastAt":"2008-06-02T17:53:38Z","messageCount":10,"participants":["Stephan Beyer","Junio C Hamano","Teemu Likonen","Andreas Ericsson"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"78145","messageId":"20080530140447.GB10514@leksak.fem-net","threadId":"13733","inReplyTo":null,"subject":"[PATCH] Add test cases for git-am","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-05-30T14:04:47Z","receivedAt":"2008-05-30T14:04:47Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Add t/t4151-am.sh that does basic testing of git-am functionality,\nincluding:\n * am applies patch correctly\n * am changes committer and keeps author\n * am --signoff adds Signed-off-by: line\n * am stays in branch\n * am --signoff does not add Signed-off-by: line if already there\n * am without --keep removes Re: and [PATCH] stuff\n * am --keep really keeps the subject\n * am -3 falls back to 3-way merge\n * am pauses on conflict\n * am --skip works\n * am --resolved works\n * am takes patches from a Pine mailbox\n * am fails on mail without patch\n * am fails on empty patch\n\nSigned-off-by: Stephan Beyer <s-beyer@gmx.net>\n---\nHi,\n\nthe reason I added this test is because I'm working on git-sequencer (for\nGSoC'08), which functions as a common backend for git-am, git-rebase, ...\nAnd I think this test will make my life easier ;-)\n\nAs this is my first test, I hope to get some constructive feedback.\n\nPerhaps it is also useful to swap t4150 and t4151 or to merge them.\n\nAh, and I omitted tests for --whitespace and some other git-apply-specific\nstuff.\n\nRegards,\n  Stephan\n\n t/t4151-am.sh |  223 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 223 insertions(+), 0 deletions(-)\n create mode 100755 t/t4151-am.sh\n\ndiff --git a/t/t4151-am.sh b/t/t4151-am.sh\nnew file mode 100755\nindex 0000000..df4fb5a\n--- /dev/null\n+++ b/t/t4151-am.sh\n@@ -0,0 +1,223 @@\n+#!/bin/sh\n+\n+test_description='git am running'\n+\n+. ./test-lib.sh\n+\n+cat >msg <<EOF\n+second\n+\n+Lorem ipsum dolor sit amet, consectetuer sadipscing elitr, sed diam nonumy\n+eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam\n+voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita\n+kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem\n+ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod\n+tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At\n+vero eos et accusam et justo duo dolores et ea rebum.\n+\n+\tDuis autem vel eum iriure dolor in hendrerit in vulputate velit\n+\tesse molestie consequat, vel illum dolore eu feugiat nulla facilisis\n+\tat vero eros et accumsan et iusto odio dignissim qui blandit\n+\tpraesent luptatum zzril delenit augue duis dolore te feugait nulla\n+\tfacilisi.\n+\n+\n+Lorem ipsum dolor sit amet,\n+consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut\n+laoreet dolore magna aliquam erat volutpat.\n+\n+  git\n+  ---\n+  +++\n+\n+Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit\n+lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure\n+dolor in hendrerit in vulputate velit esse molestie consequat, vel illum\n+dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio\n+dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te\n+feugait nulla facilisi.\n+EOF\n+\n+cat >failmail <<EOF\n+From foo@example.com Fri May 23 10:43:49 2008\n+From:\tfoo@example.com\n+To:\tbar@example.com\n+Subject: Re: [RFC/PATCH] git-foo.sh\n+Date:\tFri, 23 May 2008 05:23:42 +0200\n+\n+Sometimes we have to find out that there's nothing left.\n+\n+EOF\n+\n+cat >pine <<EOF\n+From MAILER-DAEMON Fri May 23 10:43:49 2008\n+Date: 23 May 2008 05:23:42 +0200\n+From: Mail System Internal Data <MAILER-DAEMON@example.com>\n+Subject: DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA\n+Message-ID: <foo-0001@example.com>\n+\n+This text is part of the internal format of your mail folder, and is not\n+a real message.  It is created automatically by the mail system software.\n+If deleted, important folder data will be lost, and it will be re-created\n+with the data reset to initial values.\n+\n+EOF\n+\n+test_expect_success setup '\n+\techo hello >file &&\n+\tgit add file &&\n+\ttest_tick &&\n+\tgit commit -m first &&\n+\tgit tag first &&\n+\techo world >>file &&\n+\tgit add file &&\n+\ttest_tick &&\n+\tgit commit -s -F msg &&\n+\tgit tag second &&\n+\tgit format-patch --stdout first >patch1 &&\n+\ttail -n +3 msg >file &&\n+\tgit add file &&\n+\ttest_tick &&\n+\tgit commit -m third &&\n+\tgit tag third &&\n+\tgit format-patch --stdout first >patch2\t&&\n+\tgit checkout -b lorem &&\n+\ttail -n +11 msg >file &&\n+\thead -n +9 msg >>file &&\n+\ttest_tick &&\n+\tgit commit -a -m \"moved stuff\" &&\n+\techo goodbye >another &&\n+\tgit add another &&\n+\ttest_tick &&\n+\tgit commit -m \"added another file\" &&\n+\tgit format-patch --stdout master >lorem-move.patch\n+'\n+\n+# reset time\n+unset test_tick\n+test_tick\n+\n+test_expect_success 'am applies patch correctly' '\n+\tgit checkout first &&\n+\ttest_tick &&\n+\tgit am <patch1 &&\n+\t! test -d .dotest &&\n+\ttest -z \"$(git diff second)\" &&\n+\ttest \"$(git rev-parse second)\" = \"$(git rev-parse HEAD)\" &&\n+\ttest \"$(git rev-parse second^)\" = \"$(git rev-parse HEAD^)\"\n+'\n+\n+GIT_AUTHOR_NAME=\"Another Thor\"\n+GIT_AUTHOR_EMAIL=\"a.thor@example.com\"\n+GIT_COMMITTER_NAME=\"Co M Miter\" \n+GIT_COMMITTER_EMAIL=\"c.miter@example.com\"\n+export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL\n+\n+compare () {\n+\ttest \"$(git cat-file commit \"$2\" | grep \"^$1 \")\" = \\\n+\t     \"$(git cat-file commit \"$3\" | grep \"^$1 \")\"\n+}\n+\n+test_expect_success 'am changes committer and keeps author' '\n+\ttest_tick &&\n+\tgit checkout first &&\n+\tgit am patch2 &&\n+\t! test -d .dotest &&\n+\ttest \"$(git rev-parse master)\" != \"$(git rev-parse HEAD)\" &&\n+\ttest \"$(git rev-parse master^)\" != \"$(git rev-parse HEAD^)\" &&\n+\ttest \"$(git rev-parse master^^)\" = \"$(git rev-parse HEAD^^)\" &&\n+\ttest -z \"$(git diff master..HEAD)\" &&\n+\ttest -z \"$(git diff master^..HEAD^)\" &&\n+\tcompare author master HEAD &&\n+\tcompare author master^ HEAD^ &&\n+\t! compare committer master HEAD &&\n+\t! compare committer master^ HEAD^\n+'\n+\n+test_expect_success 'am --signoff adds Signed-off-by: line' '\n+\tgit checkout -b master2 first &&\n+\tgit am --signoff <patch2 &&\n+\ttest \"$(git cat-file commit HEAD | grep -c \"^Signed-off-by:\")\" -eq 1 &&\n+\ttest \"$(git cat-file commit HEAD^ | grep -c \"^Signed-off-by:\")\" -eq 2\n+'\n+\n+test_expect_success 'am stays in branch' '\n+\ttest \"refs/heads/master2\" = \"$(git symbolic-ref HEAD)\"\n+'\n+\n+test_expect_success 'am --signoff does not add Signed-off-by: line if already there' '\n+\tgit format-patch --stdout HEAD^ >patch3 &&\n+\tsed -e \"/^Subject/ s,\\[PATCH,Re: Re: Re: & 1/5 v2,\" patch3 >patch4\n+\tgit checkout HEAD^ &&\n+\tgit am --signoff patch4 &&\n+\ttest \"$(git cat-file commit HEAD | grep -c \"^Signed-off-by:\")\" -eq 1\n+'\n+\n+test_expect_success 'am without --keep removes Re: and [PATCH] stuff' '\n+\ttest \"$(git rev-parse HEAD)\" = \"$(git rev-parse master2)\"\n+'\n+\n+test_expect_success 'am --keep really keeps the subject' '\n+\tgit checkout HEAD^ &&\n+\tgit am --keep patch4 &&\n+\t! test -d .dotest &&\n+\tgit-cat-file commit HEAD |\n+\t\tgrep -q -F \"Re: Re: Re: [PATCH 1/5 v2] third\"\n+'\n+\n+test_expect_success 'am -3 falls back to 3-way merge' '\n+\tgit checkout -b lorem2 master2 &&\n+\ttail -n +3 msg >file &&\n+\thead -n +9 msg >>file &&\n+\tgit add file &&\n+\ttest_tick &&\n+\tgit commit -m \"copied stuff\" &&\n+\tgit am -3 lorem-move.patch &&\n+\t! test -d .dotest &&\n+\ttest -z \"$(git diff lorem)\"\n+'\n+\n+test_expect_success 'am pauses on conflict' '\n+\tgit checkout lorem2^^ &&\n+\t! git am lorem-move.patch &&\n+\ttest -d .dotest\n+'\n+\n+test_expect_success 'am --skip works' '\n+\tgit am --skip &&\n+\t! test -d .dotest &&\n+\ttest -z \"$(git diff lorem2^^ -- file)\" &&\n+\ttest goodbye = \"$(cat another)\"\n+'\n+\n+test_expect_success 'am --resolved works' '\n+\tgit checkout lorem2^^ &&\n+\t! git am lorem-move.patch &&\n+\ttest -d .dotest &&\n+\techo resolved >>file &&\n+\tgit add file &&\n+\tgit am --resolved &&\n+\t! test -d .dotest &&\n+\ttest goodbye = \"$(cat another)\"\n+'\n+\n+test_expect_success 'am takes patches from a Pine mailbox' '\n+\tgit checkout first &&\n+\tcat pine patch1 | git am &&\n+\t! test -d .dotest &&\n+\ttest -z \"$(git diff master^..HEAD)\"\n+'\n+\n+test_expect_success 'am fails on mail without patch' '\n+\t! git am <failmail &&\n+\trm -r .dotest/\n+'\n+\n+test_expect_success 'am fails on empty patch' '\n+\techo \"---\" >>failmail &&\n+\t! git am <failmail &&\n+\tgit am --skip &&\n+\t! test -d .dotest\n+'\n+\n+test_done\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"78191","messageId":"7vy75rh25i.fsf@gitster.siamese.dyndns.org","threadId":"13733","inReplyTo":"20080530140447.GB10514@leksak.fem-net","subject":"Re: [PATCH] Add test cases for git-am","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-30T22:12:41Z","receivedAt":"2008-05-30T22:12:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephan Beyer <s-beyer@gmx.net> writes:\n\n> the reason I added this test is because I'm working on git-sequencer (for\n> GSoC'08), which functions as a common backend for git-am, git-rebase, ...\n> And I think this test will make my life easier ;-)\n\nAbsolutely.  Starting by writing a verifiable specification of what you\nwill be building (aka \"tests\") is a very good way.\n\n> As this is my first test, I hope to get some constructive feedback.\n\n    Date: Fri, 30 May 2008 16:04:47 +0200\n    From: Stephan Beyer <s-beyer@gmx.net>\n    To: git@vger.kernel.org\n    Cc: gitster@pobox.com\n    Subject: [PATCH] Add test cases for git-am\n    Message-ID: <20080530140447.GB10514@leksak.fem-net>\n    Mail-Followup-To: git@vger.kernel.org, gitster@pobox.com\n\nPlease don't do this \"Mail-Followup-To:\"; it is rude to others, and it is\nrude to me.\n\n * It is rude to others.  When they want to give feedback to _you_\n   privately and say \"Reply\", it will put me (and the list) on \"To:\"\n   header.  They have to be careful and edit their \"To:\" header.  You\n   stole time from them, which otherwise would have been spent on much\n   better things, such as actually giving constructive feedbacks.\n\n * It is rude to me (or whoever you place on your M-F-T).  I filter and\n   sort my incoming mails to give precedence to ones that have me on \"To:\"\n   over the ones that have me on \"Cc:\".  When people want to give feedback\n   to _you_ publicly and say \"Reply All\", it will again put me (and\n   perhaps the list) on \"To:\" header, and I may not be interested in\n   suggestions they are giving to _you_.  You stole time from me, which\n   otherwise would have been spent on something better, like sitting back\n   and sipping my Caipirinha ;-).\n\n> Perhaps it is also useful to swap t4150 and t4151 or to merge them.\n\nPehaps.  A single test t4150-am.sh might be enough.\n\n> diff --git a/t/t4151-am.sh b/t/t4151-am.sh\n> new file mode 100755\n> index 0000000..df4fb5a\n> --- /dev/null\n> +++ b/t/t4151-am.sh\n> @@ -0,0 +1,223 @@\n> +#!/bin/sh\n> +\n> +test_description='git am running'\n> +\n> +. ./test-lib.sh\n> +\n> +cat >msg <<EOF\n> +second\n> +\n> +Lorem ipsum dolor sit amet, consectetuer sadipscing elitr, sed diam nonumy\n> +...\n> +feugait nulla facilisi.\n> +EOF\n> ...\n> +test_expect_success setup '\n> +\techo hello >file &&\n> +\tgit add file &&\n> +\ttest_tick &&\n> +\tgit commit -m first &&\n> +\tgit tag first &&\n> +\techo world >>file &&\n> +\tgit add file &&\n> +\ttest_tick &&\n> +\tgit commit -s -F msg &&\n> +\tgit tag second &&\n> +\tgit format-patch --stdout first >patch1 &&\n> +\ttail -n +3 msg >file &&\n\n\"tail -n 3\" you mean?  Same for \"head -n <n>\" in other places.\n\n> ...\n> +test_expect_success 'am changes committer and keeps author' '\n> +\ttest_tick &&\n> +\tgit checkout first &&\n> +\tgit am patch2 &&\n> +\t! test -d .dotest &&\n> +\ttest \"$(git rev-parse master)\" != \"$(git rev-parse HEAD)\" &&\n> +\ttest \"$(git rev-parse master^)\" != \"$(git rev-parse HEAD^)\" &&\n> +\ttest \"$(git rev-parse master^^)\" = \"$(git rev-parse HEAD^^)\" &&\n> +\ttest -z \"$(git diff master..HEAD)\" &&\n> +\ttest -z \"$(git diff master^..HEAD^)\" &&\n> +\tcompare author master HEAD &&\n> +\tcompare author master^ HEAD^ &&\n> +\t! compare committer master HEAD &&\n> +\t! compare committer master^ HEAD^\n> +'\n\nHmmm.  Checking for inequality does not feel so robust.  You will allow\n\"am\" to record garbage and will not be able to detect a breakage.\n\n> +test_expect_success 'am --signoff adds Signed-off-by: line' '\n> +\tgit checkout -b master2 first &&\n> +\tgit am --signoff <patch2 &&\n> +\ttest \"$(git cat-file commit HEAD | grep -c \"^Signed-off-by:\")\" -eq 1 &&\n> +\ttest \"$(git cat-file commit HEAD^ | grep -c \"^Signed-off-by:\")\" -eq 2\n> +'\n\nAgain, don't you want to check not just \"It added something\", but \"It\nadded what we expected it to add\"?\n\n> ...\n> +test_expect_success 'am --keep really keeps the subject' '\n> +\tgit checkout HEAD^ &&\n> +\tgit am --keep patch4 &&\n> +\t! test -d .dotest &&\n> +\tgit-cat-file commit HEAD |\n> +\t\tgrep -q -F \"Re: Re: Re: [PATCH 1/5 v2] third\"\n> +'\n\n... in other words, like this one that checks \"It left what we expected it\nto in the result\".\n\nOther than that, I did not think anything obviously wrong with the patch. \n"},{"id":"78205","messageId":"20080531024027.GB5907@leksak.fem-net","threadId":"13733","inReplyTo":"7vy75rh25i.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add test cases for git-am","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-05-31T02:40:27Z","receivedAt":"2008-05-31T02:40:27Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\n>     Mail-Followup-To: git@vger.kernel.org, gitster@pobox.com\n> \n> Please don't do this \"Mail-Followup-To:\"; it is rude to others, and it is\n> rude to me.\n\nOh, it was not meant to be rude.\nIn fact, I didn't even knew that my mutt generates it. ;)\nSo I deactivated it and I hope it helps you to enjoy your Caipirinha.\n\nBtw, I'm confused whether I should use \"List reply\" (which only\nreplies to git@vger.kernel.org) or \"Reply to all\" (which I used now).\nWhile on some other mailinglists it is discouraged to \"reply to all\",\nit seems to be the common case here.\n\n> > Perhaps it is also useful to swap t4150 and t4151 or to merge them.\n> \n> Pehaps.  A single test t4150-am.sh might be enough.\n\nOk.\n\n> > +test_expect_success setup '\n> > +\techo hello >file &&\n> > +\tgit add file &&\n> > +\ttest_tick &&\n> > +\tgit commit -m first &&\n> > +\tgit tag first &&\n> > +\techo world >>file &&\n> > +\tgit add file &&\n> > +\ttest_tick &&\n> > +\tgit commit -s -F msg &&\n> > +\tgit tag second &&\n> > +\tgit format-patch --stdout first >patch1 &&\n> > +\ttail -n +3 msg >file &&\n> \n> \"tail -n 3\" you mean?\n\nNo :-)\n\"tail -n 3\" or \"tail -n -3\" results in the last three lines, but\n\"tail -n +3\" results in the last lines beginning from the third line.\n\nAll three cases are POSIX-conform according to the online specs of \nIEEE or OpenGroup, e.g. see\n\thttp://www.opengroup.org/onlinepubs/009695399/utilities/tail.html\n\n> Same for \"head -n <n>\" in other places.\n\nHere you are right that \"head -n 3\" equals \"head -n +3\", since both\nresult in the first three lines. (\"head -n -3\" results in all lines\nexcept the last three.)\nI kept the '+'-prefix for consistency, but I can remove it if you like.\n\n> > +test_expect_success 'am changes committer and keeps author' '\n> > +\ttest_tick &&\n> > +\tgit checkout first &&\n> > +\tgit am patch2 &&\n> > +\t! test -d .dotest &&\n> > +\ttest \"$(git rev-parse master)\" != \"$(git rev-parse HEAD)\" &&\n> > +\ttest \"$(git rev-parse master^)\" != \"$(git rev-parse HEAD^)\" &&\n> > +\ttest \"$(git rev-parse master^^)\" = \"$(git rev-parse HEAD^^)\" &&\n> > +\ttest -z \"$(git diff master..HEAD)\" &&\n> > +\ttest -z \"$(git diff master^..HEAD^)\" &&\n> > +\tcompare author master HEAD &&\n> > +\tcompare author master^ HEAD^ &&\n> > +\t! compare committer master HEAD &&\n> > +\t! compare committer master^ HEAD^\n> > +'\n> \n> Hmmm.  Checking for inequality does not feel so robust.  You will allow\n> \"am\" to record garbage and will not be able to detect a breakage.\n\nOh, right.\n\nDoes this feel better?\n--- a/t/t4151-am.sh\n+++ b/t/t4151-am.sh\n@@ -123,15 +123,13 @@ test_expect_success 'am changes committer and keeps author' '\n \tgit checkout first &&\n \tgit am patch2 &&\n \t! test -d .dotest &&\n-\ttest \"$(git rev-parse master)\" != \"$(git rev-parse HEAD)\" &&\n-\ttest \"$(git rev-parse master^)\" != \"$(git rev-parse HEAD^)\" &&\n \ttest \"$(git rev-parse master^^)\" = \"$(git rev-parse HEAD^^)\" &&\n \ttest -z \"$(git diff master..HEAD)\" &&\n \ttest -z \"$(git diff master^..HEAD^)\" &&\n \tcompare author master HEAD &&\n \tcompare author master^ HEAD^ &&\n-\t! compare committer master HEAD &&\n-\t! compare committer master^ HEAD^\n+\ttest \"Co M Miter <c.miter@example.com>\" = \\\n+\t     \"$(git log -1 --pretty=format:\"%cn <%ce>\" HEAD)\"\n '\n \n test_expect_success 'am --signoff adds Signed-off-by: line' '\n---\nOr better ideas? ;)\n\n> > +test_expect_success 'am --signoff adds Signed-off-by: line' '\n> > +\tgit checkout -b master2 first &&\n> > +\tgit am --signoff <patch2 &&\n> > +\ttest \"$(git cat-file commit HEAD | grep -c \"^Signed-off-by:\")\" -eq 1 &&\n> > +\ttest \"$(git cat-file commit HEAD^ | grep -c \"^Signed-off-by:\")\" -eq 2\n> > +'\n> \n> Again, don't you want to check not just \"It added something\", but \"It\n> added what we expected it to add\"?\n\nLike this?\n---\n test_expect_success 'am --signoff adds Signed-off-by: line' '\n \tgit checkout -b master2 first &&\n \tgit am --signoff <patch2 &&\n \ttest \"$(git cat-file commit HEAD | grep -c \"^Signed-off-by:\")\" -eq 1 &&\n-\ttest \"$(git cat-file commit HEAD^ | grep -c \"^Signed-off-by:\")\" -eq 2\n+\ttest \"$(git cat-file commit HEAD^ | grep -c \"^Signed-off-by:\")\" -eq 2 &&\n+\tgit cat-file commit HEAD | grep -q \"^Signed-off-by: Co M Miter <c.miter@example.com>$\" &&\n+\tgit cat-file commit HEAD^ | grep -q \"^Signed-off-by: Co M Miter <c.miter@example.com>$\" &&\n+\tgit cat-file commit HEAD^ | grep -q \"^Signed-off-by: C O Mitter <committer@example.com>$\"\n '\n---\n\nMh, I thought it is not bad to keep the -eq checks just to go sure nothing\nis added twice by whatever reason.\n \n\nThank you!\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"78206","messageId":"20080531062605.GA3029@mithlond.arda.local","threadId":"13733","inReplyTo":"20080531024027.GB5907@leksak.fem-net","subject":"Mutt and Mail-Followup-To","fromName":"Teemu Likonen","fromEmail":"tlikonen@iki.fi","sentAt":"2008-05-31T06:26:05Z","receivedAt":"2008-05-31T06:26:05Z","isPatch":false,"sender":{"key":"tlikonen@iki.fi","avatar":null},"body":"Stephan Beyer wrote (2008-05-31 04:40 +0200):\n\n> Oh, it was not meant to be rude. In fact, I didn't even knew that my\n> mutt generates it. ;) So I deactivated it and I hope it helps you to\n> enjoy your Caipirinha.\n> \n> Btw, I'm confused whether I should use \"List reply\" (which only\n> replies to git@vger.kernel.org) or \"Reply to all\" (which I used now).\n> While on some other mailinglists it is discouraged to \"reply to all\",\n> it seems to be the common case here.\n\nMutt's logic is pretty complicated on this. If followup_to=yes, then\nMutt generates M-F-T field and puts all the addresses gathered from To\nand CC fields there (minus user's own). In addition to that, if there's\na mailing list address which is in users's \"subscribe\" list Mutt will\nnot add users's own address to the M-F-T. If the list address is only in\n\"lists\" list, Mutt will add users's own address. The intention is to\nprevent duplicates when user is a subscriber, and to get private replies\nif user is not a subscriber.\n\nThe logic is so complicated and not very well supported so it doesn't\nwork well anyway. I think the best thing to do is:\n\n  set followup_to=no\n  set honor_followup_to=ask-no\n\nOne just has to find out if the list in question favours \"replies to\nall\" (the 'g' key in Mutt) or replies to the list only ('L' in Mutt).\n"},{"id":"78243","messageId":"7viqwuffdy.fsf@gitster.siamese.dyndns.org","threadId":"13733","inReplyTo":"20080531024027.GB5907@leksak.fem-net","subject":"Re: [PATCH] Add test cases for git-am","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-31T19:22:01Z","receivedAt":"2008-05-31T19:22:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephan Beyer <s-beyer@gmx.net> writes:\n\n>> > +\ttail -n +3 msg >file &&\n>> \n>> \"tail -n 3\" you mean?\n>\n> No :-)\n> \"tail -n 3\" or \"tail -n -3\" results in the last three lines, but\n> \"tail -n +3\" results in the last lines beginning from the third line.\n\n\"git grep 'tail.*+' -- '*.sh'\" says that this will the first and only\ninstance of \"tail -n +<number>\".  The syntax may be POSIX but not all\n/usr/bin/tail unfortunately knows about it.\n\nI tend to prefer \"sed -n -e '3,$p'\" for things like this for portability.\nIncidentally, the only /usr/bin/tail that is incapable of +number I have\naccess to is so old that it does not even want -n and only wants \"tail -3\"\nor \"tail +3\"; funnily enough, /usr/bin/head there does accept -n.\n\n>> Hmmm.  Checking for inequality does not feel so robust.  You will allow\n>> \"am\" to record garbage and will not be able to detect a breakage.\n>\n> Oh, right.\n>\n> Does this feel better?\n> --- a/t/t4151-am.sh\n> +++ b/t/t4151-am.sh\n> @@ -123,15 +123,13 @@ test_expect_success 'am changes committer and keeps author' '\n>  \tgit checkout first &&\n>  \tgit am patch2 &&\n>  \t! test -d .dotest &&\n> -\ttest \"$(git rev-parse master)\" != \"$(git rev-parse HEAD)\" &&\n> -\ttest \"$(git rev-parse master^)\" != \"$(git rev-parse HEAD^)\" &&\n>  \ttest \"$(git rev-parse master^^)\" = \"$(git rev-parse HEAD^^)\" &&\n>  \ttest -z \"$(git diff master..HEAD)\" &&\n>  \ttest -z \"$(git diff master^..HEAD^)\" &&\n>  \tcompare author master HEAD &&\n>  \tcompare author master^ HEAD^ &&\n> -\t! compare committer master HEAD &&\n> -\t! compare committer master^ HEAD^\n> +\ttest \"Co M Miter <c.miter@example.com>\" = \\\n> +\t     \"$(git log -1 --pretty=format:\"%cn <%ce>\" HEAD)\"\n>  '\n\nThat looks like a more direct approach, doesn't it?\n\n>> Again, don't you want to check not just \"It added something\", but \"It\n>> added what we expected it to add\"?\n>\n> Like this?\n> ---\n>  test_expect_success 'am --signoff adds Signed-off-by: line' '\n>  \tgit checkout -b master2 first &&\n>  \tgit am --signoff <patch2 &&\n>  \ttest \"$(git cat-file commit HEAD | grep -c \"^Signed-off-by:\")\" -eq 1 &&\n> -\ttest \"$(git cat-file commit HEAD^ | grep -c \"^Signed-off-by:\")\" -eq 2\n> +\ttest \"$(git cat-file commit HEAD^ | grep -c \"^Signed-off-by:\")\" -eq 2 &&\n> +\tgit cat-file commit HEAD | grep -q \"^Signed-off-by: Co M Miter <c.miter@example.com>$\" &&\n> +\tgit cat-file commit HEAD^ | grep -q \"^Signed-off-by: Co M Miter <c.miter@example.com>$\" &&\n> +\tgit cat-file commit HEAD^ | grep -q \"^Signed-off-by: C O Mitter <committer@example.com>$\"\n>  '\n> ---\n>\n> Mh, I thought it is not bad to keep the -eq checks just to go sure nothing\n> is added twice by whatever reason.\n\nWhy not sed out all Signed-off-by lines and make sure all of what you\nexpect to appear do appear in the order you expect them to do?\n"},{"id":"78248","messageId":"20080531220723.GD5907@leksak.fem-net","threadId":"13733","inReplyTo":"7viqwuffdy.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add test cases for git-am","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-05-31T22:07:24Z","receivedAt":"2008-05-31T22:07:24Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\n> \"git grep 'tail.*+' -- '*.sh'\" says that this will the first and only\n> instance of \"tail -n +<number>\".  The syntax may be POSIX but not all\n> /usr/bin/tail unfortunately knows about it.\n> \n> I tend to prefer \"sed -n -e '3,$p'\" for things like this for portability.\n\nI'm fine with that, but I sometimes wonder if systems that do not like\n\"tail -n +3\" really tend to like a \"sed -n -e '3,$p'\" :)\n\nWell,\nPatch v2 follows. (Let's give git-send-email a chance.)\n\nRegards,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"78250","messageId":"1212271903-14037-1-git-send-email-s-beyer@gmx.net","threadId":"13733","inReplyTo":"20080531220723.GD5907@leksak.fem-net","subject":"[PATCH v2 1/2] Add test cases for git-am","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-05-31T22:11:42Z","receivedAt":"2008-05-31T22:11:42Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Add t/t4151-am.sh that does basic testing of git-am functionality,\nincluding:\n * am applies patch correctly\n * am changes committer and keeps author\n * am --signoff adds Signed-off-by: line\n * am stays in branch\n * am --signoff does not add Signed-off-by: line if already there\n * am without --keep removes Re: and [PATCH] stuff\n * am --keep really keeps the subject\n * am -3 falls back to 3-way merge\n * am pauses on conflict\n * am --skip works\n * am --resolved works\n * am takes patches from a Pine mailbox\n * am fails on mail without patch\n * am fails on empty patch\n\nSigned-off-by: Stephan Beyer <s-beyer@gmx.net>\n---\n t/t4151-am.sh |  226 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 226 insertions(+), 0 deletions(-)\n create mode 100755 t/t4151-am.sh\n\ndiff --git a/t/t4151-am.sh b/t/t4151-am.sh\nnew file mode 100755\nindex 0000000..ec1b442\n--- /dev/null\n+++ b/t/t4151-am.sh\n@@ -0,0 +1,226 @@\n+#!/bin/sh\n+\n+test_description='git am running'\n+\n+. ./test-lib.sh\n+\n+cat >msg <<EOF\n+second\n+\n+Lorem ipsum dolor sit amet, consectetuer sadipscing elitr, sed diam nonumy\n+eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam\n+voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita\n+kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem\n+ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod\n+tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At\n+vero eos et accusam et justo duo dolores et ea rebum.\n+\n+\tDuis autem vel eum iriure dolor in hendrerit in vulputate velit\n+\tesse molestie consequat, vel illum dolore eu feugiat nulla facilisis\n+\tat vero eros et accumsan et iusto odio dignissim qui blandit\n+\tpraesent luptatum zzril delenit augue duis dolore te feugait nulla\n+\tfacilisi.\n+\n+\n+Lorem ipsum dolor sit amet,\n+consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut\n+laoreet dolore magna aliquam erat volutpat.\n+\n+  git\n+  ---\n+  +++\n+\n+Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit\n+lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure\n+dolor in hendrerit in vulputate velit esse molestie consequat, vel illum\n+dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio\n+dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te\n+feugait nulla facilisi.\n+EOF\n+\n+cat >failmail <<EOF\n+From foo@example.com Fri May 23 10:43:49 2008\n+From:\tfoo@example.com\n+To:\tbar@example.com\n+Subject: Re: [RFC/PATCH] git-foo.sh\n+Date:\tFri, 23 May 2008 05:23:42 +0200\n+\n+Sometimes we have to find out that there's nothing left.\n+\n+EOF\n+\n+cat >pine <<EOF\n+From MAILER-DAEMON Fri May 23 10:43:49 2008\n+Date: 23 May 2008 05:23:42 +0200\n+From: Mail System Internal Data <MAILER-DAEMON@example.com>\n+Subject: DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA\n+Message-ID: <foo-0001@example.com>\n+\n+This text is part of the internal format of your mail folder, and is not\n+a real message.  It is created automatically by the mail system software.\n+If deleted, important folder data will be lost, and it will be re-created\n+with the data reset to initial values.\n+\n+EOF\n+\n+echo \"Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>\" >expected\n+\n+test_expect_success setup '\n+\techo hello >file &&\n+\tgit add file &&\n+\ttest_tick &&\n+\tgit commit -m first &&\n+\tgit tag first &&\n+\techo world >>file &&\n+\tgit add file &&\n+\ttest_tick &&\n+\tgit commit -s -F msg &&\n+\tgit tag second &&\n+\tgit format-patch --stdout first >patch1 &&\n+\tsed -n -e \"3,\\$p\" msg >file &&\n+\tgit add file &&\n+\ttest_tick &&\n+\tgit commit -m third &&\n+\tgit format-patch --stdout first >patch2\t&&\n+\tgit checkout -b lorem &&\n+\tsed -n -e \"11,\\$p\" msg >file &&\n+\thead -n 9 msg >>file &&\n+\ttest_tick &&\n+\tgit commit -a -m \"moved stuff\" &&\n+\techo goodbye >another &&\n+\tgit add another &&\n+\ttest_tick &&\n+\tgit commit -m \"added another file\" &&\n+\tgit format-patch --stdout master >lorem-move.patch\n+'\n+\n+# reset time\n+unset test_tick\n+test_tick\n+\n+test_expect_success 'am applies patch correctly' '\n+\tgit checkout first &&\n+\ttest_tick &&\n+\tgit am <patch1 &&\n+\t! test -d .dotest &&\n+\ttest -z \"$(git diff second)\" &&\n+\ttest \"$(git rev-parse second)\" = \"$(git rev-parse HEAD)\" &&\n+\ttest \"$(git rev-parse second^)\" = \"$(git rev-parse HEAD^)\"\n+'\n+\n+GIT_AUTHOR_NAME=\"Another Thor\"\n+GIT_AUTHOR_EMAIL=\"a.thor@example.com\"\n+GIT_COMMITTER_NAME=\"Co M Miter\" \n+GIT_COMMITTER_EMAIL=\"c.miter@example.com\"\n+export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL\n+\n+compare () {\n+\ttest \"$(git cat-file commit \"$2\" | grep \"^$1 \")\" = \\\n+\t     \"$(git cat-file commit \"$3\" | grep \"^$1 \")\"\n+}\n+\n+test_expect_success 'am changes committer and keeps author' '\n+\ttest_tick &&\n+\tgit checkout first &&\n+\tgit am patch2 &&\n+\t! test -d .dotest &&\n+\ttest \"$(git rev-parse master^^)\" = \"$(git rev-parse HEAD^^)\" &&\n+\ttest -z \"$(git diff master..HEAD)\" &&\n+\ttest -z \"$(git diff master^..HEAD^)\" &&\n+\tcompare author master HEAD &&\n+\tcompare author master^ HEAD^ &&\n+\ttest \"$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>\" = \\\n+\t     \"$(git log -1 --pretty=format:\"%cn <%ce>\" HEAD)\"\n+'\n+\n+test_expect_success 'am --signoff adds Signed-off-by: line' '\n+\tgit checkout -b master2 first &&\n+\tgit am --signoff <patch2 &&\n+\techo \"Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>\" >>expected &&\n+\tgit cat-file commit HEAD^ | grep \"Signed-off-by:\" >actual &&\n+\ttest_cmp actual expected &&\n+\techo \"Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>\" >expected &&\n+\tgit cat-file commit HEAD | grep \"Signed-off-by:\" >actual &&\n+\ttest_cmp actual expected\n+'\n+\n+test_expect_success 'am stays in branch' '\n+\ttest \"refs/heads/master2\" = \"$(git symbolic-ref HEAD)\"\n+'\n+\n+test_expect_success 'am --signoff does not add Signed-off-by: line if already there' '\n+\tgit format-patch --stdout HEAD^ >patch3 &&\n+\tsed -e \"/^Subject/ s,\\[PATCH,Re: Re: Re: & 1/5 v2,\" patch3 >patch4\n+\tgit checkout HEAD^ &&\n+\tgit am --signoff patch4 &&\n+\ttest \"$(git cat-file commit HEAD | grep -c \"^Signed-off-by:\")\" -eq 1\n+'\n+\n+test_expect_success 'am without --keep removes Re: and [PATCH] stuff' '\n+\ttest \"$(git rev-parse HEAD)\" = \"$(git rev-parse master2)\"\n+'\n+\n+test_expect_success 'am --keep really keeps the subject' '\n+\tgit checkout HEAD^ &&\n+\tgit am --keep patch4 &&\n+\t! test -d .dotest &&\n+\tgit-cat-file commit HEAD |\n+\t\tgrep -q -F \"Re: Re: Re: [PATCH 1/5 v2] third\"\n+'\n+\n+test_expect_success 'am -3 falls back to 3-way merge' '\n+\tgit checkout -b lorem2 master2 &&\n+\tsed -n -e \"3,\\$p\" msg >file &&\n+\thead -n 9 msg >>file &&\n+\tgit add file &&\n+\ttest_tick &&\n+\tgit commit -m \"copied stuff\" &&\n+\tgit am -3 lorem-move.patch &&\n+\t! test -d .dotest &&\n+\ttest -z \"$(git diff lorem)\"\n+'\n+\n+test_expect_success 'am pauses on conflict' '\n+\tgit checkout lorem2^^ &&\n+\t! git am lorem-move.patch &&\n+\ttest -d .dotest\n+'\n+\n+test_expect_success 'am --skip works' '\n+\tgit am --skip &&\n+\t! test -d .dotest &&\n+\ttest -z \"$(git diff lorem2^^ -- file)\" &&\n+\ttest goodbye = \"$(cat another)\"\n+'\n+\n+test_expect_success 'am --resolved works' '\n+\tgit checkout lorem2^^ &&\n+\t! git am lorem-move.patch &&\n+\ttest -d .dotest &&\n+\techo resolved >>file &&\n+\tgit add file &&\n+\tgit am --resolved &&\n+\t! test -d .dotest &&\n+\ttest goodbye = \"$(cat another)\"\n+'\n+\n+test_expect_success 'am takes patches from a Pine mailbox' '\n+\tgit checkout first &&\n+\tcat pine patch1 | git am &&\n+\t! test -d .dotest &&\n+\ttest -z \"$(git diff master^..HEAD)\"\n+'\n+\n+test_expect_success 'am fails on mail without patch' '\n+\t! git am <failmail &&\n+\trm -r .dotest/\n+'\n+\n+test_expect_success 'am fails on empty patch' '\n+\techo \"---\" >>failmail &&\n+\t! git am <failmail &&\n+\tgit am --skip &&\n+\t! test -d .dotest\n+'\n+\n+test_done\n-- \n1.5.5.1\n"},{"id":"78249","messageId":"1212271903-14037-2-git-send-email-s-beyer@gmx.net","threadId":"13733","inReplyTo":"1212271903-14037-1-git-send-email-s-beyer@gmx.net","subject":"[PATCH v2 2/2] Merge t4150-am-subdir.sh and t4151-am.sh into t4150-am.sh","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-05-31T22:11:43Z","receivedAt":"2008-05-31T22:11:43Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"This patch moves the am test cases in t4150-am.sh and the\nam subdirectory test cases from t/t4150-am-subdir.sh into\nt/4151-am.sh.\n\nSigned-off-by: Stephan Beyer <s-beyer@gmx.net>\n---\n t/t4150-am-subdir.sh           |   72 ----------------------------------------\n t/{t4151-am.sh => t4150-am.sh} |   34 +++++++++++++++++++\n 2 files changed, 34 insertions(+), 72 deletions(-)\n delete mode 100755 t/t4150-am-subdir.sh\n rename t/{t4151-am.sh => t4150-am.sh} (90%)\n\ndiff --git a/t/t4150-am-subdir.sh b/t/t4150-am-subdir.sh\ndeleted file mode 100755\nindex 52069b4..0000000\n--- a/t/t4150-am-subdir.sh\n+++ /dev/null\n@@ -1,72 +0,0 @@\n-#!/bin/sh\n-\n-test_description='git am running from a subdirectory'\n-\n-. ./test-lib.sh\n-\n-test_expect_success setup '\n-\techo hello >world &&\n-\tgit add world &&\n-\ttest_tick &&\n-\tgit commit -m initial &&\n-\tgit tag initial &&\n-\techo goodbye >world &&\n-\tgit add world &&\n-\ttest_tick &&\n-\tgit commit -m second &&\n-\tgit format-patch --stdout HEAD^ >patchfile &&\n-\t: >expect\n-'\n-\n-test_expect_success 'am regularly from stdin' '\n-\tgit checkout initial &&\n-\tgit am <patchfile &&\n-\tgit diff master >actual &&\n-\ttest_cmp expect actual\n-'\n-\n-test_expect_success 'am regularly from file' '\n-\tgit checkout initial &&\n-\tgit am patchfile &&\n-\tgit diff master >actual &&\n-\ttest_cmp expect actual\n-'\n-\n-test_expect_success 'am regularly from stdin in subdirectory' '\n-\trm -fr subdir &&\n-\tgit checkout initial &&\n-\t(\n-\t\tmkdir -p subdir &&\n-\t\tcd subdir &&\n-\t\tgit am <../patchfile\n-\t) &&\n-\tgit diff master>actual &&\n-\ttest_cmp expect actual\n-'\n-\n-test_expect_success 'am regularly from file in subdirectory' '\n-\trm -fr subdir &&\n-\tgit checkout initial &&\n-\t(\n-\t\tmkdir -p subdir &&\n-\t\tcd subdir &&\n-\t\tgit am ../patchfile\n-\t) &&\n-\tgit diff master >actual &&\n-\ttest_cmp expect actual\n-'\n-\n-test_expect_success 'am regularly from file in subdirectory with full path' '\n-\trm -fr subdir &&\n-\tgit checkout initial &&\n-\tP=$(pwd) &&\n-\t(\n-\t\tmkdir -p subdir &&\n-\t\tcd subdir &&\n-\t\tgit am \"$P/patchfile\"\n-\t) &&\n-\tgit diff master >actual &&\n-\ttest_cmp expect actual\n-'\n-\n-test_done\ndiff --git a/t/t4151-am.sh b/t/t4150-am.sh\nsimilarity index 90%\nrename from t/t4151-am.sh\nrename to t/t4150-am.sh\nindex ec1b442..722ae96 100755\n--- a/t/t4151-am.sh\n+++ b/t/t4150-am.sh\n@@ -223,4 +223,38 @@ test_expect_success 'am fails on empty patch' '\n \t! test -d .dotest\n '\n \n+test_expect_success 'am works from stdin in subdirectory' '\n+\trm -fr subdir &&\n+\tgit checkout first &&\n+\t(\n+\t\tmkdir -p subdir &&\n+\t\tcd subdir &&\n+\t\tgit am <../patch1\n+\t) &&\n+\ttest -z \"$(git diff second)\"\n+'\n+\n+test_expect_success 'am works from file (relative path given) in subdirectory' '\n+\trm -fr subdir &&\n+\tgit checkout first &&\n+\t(\n+\t\tmkdir -p subdir &&\n+\t\tcd subdir &&\n+\t\tgit am ../patch1\n+\t) &&\n+\ttest -z \"$(git diff second)\"\n+'\n+\n+test_expect_success 'am works from file (absolute path given) in subdirectory' '\n+\trm -fr subdir &&\n+\tgit checkout first &&\n+\tP=$(pwd) &&\n+\t(\n+\t\tmkdir -p subdir &&\n+\t\tcd subdir &&\n+\t\tgit am \"$P/patch1\"\n+\t) &&\n+\ttest -z \"$(git diff second)\"\n+'\n+\n test_done\n-- \n1.5.5.1\n"},{"id":"78253","messageId":"7vod6mdrlp.fsf@gitster.siamese.dyndns.org","threadId":"13733","inReplyTo":"20080531220723.GD5907@leksak.fem-net","subject":"Re: [PATCH] Add test cases for git-am","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-31T22:41:06Z","receivedAt":"2008-05-31T22:41:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephan Beyer <s-beyer@gmx.net> writes:\n\n>> I tend to prefer \"sed -n -e '3,$p'\" for things like this for portability.\n>\n> I'm fine with that, but I sometimes wonder if systems that do not like\n> \"tail -n +3\" really tend to like a \"sed -n -e '3,$p'\" :)\n\nWhy?  sed is as old as V7, which does not have \"tail -n\".\n"},{"id":"78389","messageId":"484433A2.7080600@op5.se","threadId":"13733","inReplyTo":"20080531220723.GD5907@leksak.fem-net","subject":"Re: [PATCH] Add test cases for git-am","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2008-06-02T17:53:38Z","receivedAt":"2008-06-02T17:53:38Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Stephan Beyer wrote:\n> Hi,\n> \n>> \"git grep 'tail.*+' -- '*.sh'\" says that this will the first and only\n>> instance of \"tail -n +<number>\".  The syntax may be POSIX but not all\n>> /usr/bin/tail unfortunately knows about it.\n>>\n>> I tend to prefer \"sed -n -e '3,$p'\" for things like this for portability.\n> \n> I'm fine with that, but I sometimes wonder if systems that do not like\n> \"tail -n +3\" really tend to like a \"sed -n -e '3,$p'\" :)\n> \n\nI have yet to come across a sed which doesn't support -n, the range\nspecifier and the p command, so yes, \"sed -n -e '3,$p'\" is very\nportable indeed.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"}]}