{"thread":{"id":"20417","subject":"What's in git.git (Aug 2009, #01; Wed, 05)","startedAt":"2009-08-05T22:04:10Z","lastAt":"2009-08-07T14:01:43Z","messageCount":24,"participants":["Junio C Hamano","Brandon Casey","Nicolas Sebrecht","Jeff King","Nanako Shiraishi"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"119712","messageId":"7vd479x6hx.fsf@alter.siamese.dyndns.org","threadId":"20417","inReplyTo":null,"subject":"What's in git.git (Aug 2009, #01; Wed, 05)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-05T22:04:10Z","receivedAt":"2009-08-05T22:04:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The 1.6.4 release seems to have been quite solid, and there is no\nbrown-paper-bag bugfixes on 'maint' yet ;-).\n\nA handful of topics have graduated to 'master'.\n\n* The 'maint' branch has these fixes since the last announcement.\n\nBjörn Steinbrink (1):\n  config: Keep inner whitespace verbatim\n\nErik Faye-Lund (1):\n  send-email: remove debug trace\n\nJakub Narebski (1):\n  gitweb/README: Document $base_url\n\nJens Lehmann (1):\n  Documentation: git submodule: add missing options to synopsis\n\nMatthieu Moy (1):\n  Better usage string for reflog.\n\nMiklos Vajna (1):\n  hg-to-git: don't import the unused popen2 module\n\n\n* The 'master' branch has these since the last announcement\n  in addition to the above.\n\nAndré Goddard Rosa (1):\n  Fix typos on pt_BR/gittutorial.txt translation\n\nGeoffrey Irving (1):\n  git fast-export: add --no-data option\n\nGiuseppe Bilotta (1):\n  gitweb: fix 'Use of uninitialized value' error in href()\n\nJeff King (2):\n  show: suppress extra newline when showing annotated tag\n  show: add space between multiple items\n\nJohannes Schindelin (1):\n  parse-opt: optionally show \"--no-\" option string\n\nJunio C Hamano (1):\n  apply: notice creation/removal patches produced by GNU diff\n\nMichael J Gruber (3):\n  t6010-merge-base.sh: Depict the octopus test graph\n  git-merge-base/git-show-branch: Cleanup documentation and usage\n  git-merge-base/git-show-branch --merge-base: Documentation and test\n\nMichał Kiedrowicz (1):\n  init-db: migrate to parse-options\n\nNanako Shiraishi (1):\n  git init: optionally allow a directory argument\n\nNick Edelen (1):\n  Shift object enumeration out of upload-pack\n\nSanti Béjar (2):\n  t5520-pull: Test for rebased upstream + fetch + pull --rebase\n  pull: support rebased upstream + fetch + pull --rebase\n\nStephen Boyd (7):\n  read-tree: convert unhelpful usage()'s to helpful die()'s\n  read-tree: migrate to parse-options\n  write-tree: migrate to parse-options\n  verify-tag: migrate to parse-options\n  verify-pack: migrate to parse-options\n  prune-packed: migrate to parse-options\n  technical-docs: document tree-walking API\n\nWesley J. Landaker (2):\n  Documentation: git-send-email: fix submission port number\n  Documentation: git-send-email: correct statement about standard ports\n"},{"id":"119840","messageId":"MEhvdM_GHnyaFj9ZU3lxKS47vmOk5BKslGm0FxkE_lg0SQT5Zx6KhA@cipher.nrlssc.navy.mil","threadId":"20417","inReplyTo":"7vd479x6hx.fsf@alter.siamese.dyndns.org","subject":"Re: What's in git.git (Aug 2009, #01; Wed, 05)","fromName":"Brandon Casey","fromEmail":"brandon.casey.ctr@nrlssc.navy.mil","sentAt":"2009-08-06T22:24:00Z","receivedAt":"2009-08-06T22:24:00Z","isPatch":false,"sender":{"key":"brandon.casey.ctr@nrlssc.navy.mil","avatar":null},"body":"Junio C Hamano wrote:\n> The 1.6.4 release seems to have been quite solid, and there is no\n> brown-paper-bag bugfixes on 'maint' yet ;-).\n\nFound one.\n\nI didn't realize the whole git-am discussion did _not_ result in a\nfix being applied.  But git-am will currently refuse to apply any\npatch from email that does not have \"From \" or \"From: \" in the first\nthree lines of the email.  For those of us whose mail servers prepend\nmany lines of the form:\n\nReceived: from XXX ([XXX]) by XXX with Microsoft SMTPSVC(6.0.3790.2825);\n\t Tue, 14 Jul 2009 07:24:06 -0500\nReceived: by XXX id n6ECJvlh010405; Tue, 14 Jul 2009 07:24:05 -0500\nReceived: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751929AbZGNMYD (ORCPT <rfc822;XXX@XXX>);\n\tTue, 14 Jul 2009 08:24:03 -0400\nReceived: (majordomo@vger.kernel.org) by vger.kernel.org id S1752103AbZGNMYC\n\t(ORCPT <rfc822;git-outgoing>); Tue, 14 Jul 2009 08:24:02 -0400\nReceived: from mail-ew0-f226.google.com ([209.85.219.226]:50485 \"EHLO\n\tmail-ew0-f226.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751626AbZGNMYB (ORCPT <rfc822;git@vger.kernel.org>);\n\tTue, 14 Jul 2009 08:24:01 -0400\n\nWe can not apply any patches saved from email.\n\n\nI think we should at least do this to fall back to mbox format:\n\ndiff --git a/git-am.sh b/git-am.sh\nindex d64d997..94fa9c9 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -187,6 +187,7 @@ check_patch_format () {\n \t\t\t\tpatch_format=stgit\n \t\t\t\t;;\n \t\t\t*)\n+\t\t\t\tpatch_format=mbox\n \t\t\t\t;;\n \t\t\tesac\n \t\t\t;;\n\n-brandon\n"},{"id":"119845","messageId":"20090806231759.GC12924@vidovic","threadId":"20417","inReplyTo":"MEhvdM_GHnyaFj9ZU3lxKS47vmOk5BKslGm0FxkE_lg0SQT5Zx6KhA@cipher.nrlssc.navy.mil","subject":"Re: What's in git.git (Aug 2009, #01; Wed, 05)","fromName":"Nicolas Sebrecht","fromEmail":"nicolas.s.dev@gmx.fr","sentAt":"2009-08-06T23:17:59Z","receivedAt":"2009-08-06T23:17:59Z","isPatch":false,"sender":{"key":"nicolas.s.dev@gmx.fr","avatar":null},"body":"The 06/08/09, Brandon Casey wrote:\n\n> I think we should at least do this to fall back to mbox format:\n> \n> diff --git a/git-am.sh b/git-am.sh\n> index d64d997..94fa9c9 100755\n> --- a/git-am.sh\n> +++ b/git-am.sh\n> @@ -187,6 +187,7 @@ check_patch_format () {\n>  \t\t\t\tpatch_format=stgit\n>  \t\t\t\t;;\n>  \t\t\t*)\n> +\t\t\t\tpatch_format=mbox\n>  \t\t\t\t;;\n>  \t\t\tesac\n>  \t\t\t;;\n\nThis is even better that all my crap. But I think we should squash\nthis:\n\n---\n git-am.sh |    3 ---\n 1 files changed, 0 insertions(+), 3 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 94fa9c9..e8ec8d7 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -254,9 +254,6 @@ split_patches () {\n                this=\n                msgnum=\n                ;;\n-       *)\n-               clean_abort \"Patch format $patch_format is not supported.\"\n-               ;;\n        esac\n }\n\n\n-- \nNicolas Sebrecht\n"},{"id":"119848","messageId":"20090806232818.GD12924@vidovic","threadId":"20417","inReplyTo":"20090806231759.GC12924@vidovic","subject":"Re: What's in git.git (Aug 2009, #01; Wed, 05)","fromName":"Nicolas Sebrecht","fromEmail":"nicolas.s.dev@gmx.fr","sentAt":"2009-08-06T23:28:18Z","receivedAt":"2009-08-06T23:28:18Z","isPatch":false,"sender":{"key":"nicolas.s.dev@gmx.fr","avatar":null},"body":"The 07/08/09, Nicolas Sebrecht wrote:\n> \n> This is even better that all my crap. But I think we should squash\n> this:\n> \n> ---\n>  git-am.sh |    3 ---\n>  1 files changed, 0 insertions(+), 3 deletions(-)\n> \n> diff --git a/git-am.sh b/git-am.sh\n> index 94fa9c9..e8ec8d7 100755\n> --- a/git-am.sh\n> +++ b/git-am.sh\n> @@ -254,9 +254,6 @@ split_patches () {\n>                 this=\n>                 msgnum=\n>                 ;;\n> -       *)\n> -               clean_abort \"Patch format $patch_format is not supported.\"\n> -               ;;\n>         esac\n>  }\n\nWhich is wrong as it could be given at the command line. Sorry for the\nnoise.\n\n-- \nNicolas Sebrecht\n"},{"id":"119858","messageId":"COrzR9ThNBy5SQ7chsXyUOUuBmX-VWMCz3MUVwvBOlIZzlIXRRMP6EMS7BRy_6uJvxt5H-FbtdY@cipher.nrlssc.navy.mil","threadId":"20417","inReplyTo":"MEhvdM_GHnyaFj9ZU3lxKS47vmOk5BKslGm0FxkE_lg0SQT5Zx6KhA@cipher.nrlssc.navy.mil","subject":"[PATCH 1/3] t4150-am: demonstrate git-am's failure to handle some patch emails","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-08-07T01:08:11Z","receivedAt":"2009-08-07T01:08:11Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"From: Brandon Casey <drafnel@gmail.com>\n\nRecently git-am gained the ability to detect and apply patches from some\nforeign VCS's.  The detection of traditional patch emails though is somewhat\nlimited and will fail if a \"From\" field is not detected in the first three\nlines of the email header.  Demonstrate the failure by supplying a\nperfectly valid email to git-am which it formerly could successfully apply.\n\nSigned-off-by: Brandon Casey <drafnel@gmail.com>\n---\n t/t4150-am.sh |   15 +++++++++++++++\n 1 files changed, 15 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex a12bf84..ad2a85f 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -77,6 +77,12 @@ test_expect_success setup '\n \tgit commit -s -F msg &&\n \tgit tag second &&\n \tgit format-patch --stdout first >patch1 &&\n+\t{\n+\t\techo \"X-Fake-Field: Line One\" &&\n+\t\techo \"X-Fake-Field: Line Two\" &&\n+\t\techo \"X-Fake-Field: Line Three\" &&\n+\t\tgit format-patch --stdout first | sed -e \"1d\"\n+\t} > patch1.eml &&\n \tsed -n -e \"3,\\$p\" msg >file &&\n \tgit add file &&\n \ttest_tick &&\n@@ -108,6 +114,15 @@ test_expect_success 'am applies patch correctly' '\n \ttest \"$(git rev-parse second^)\" = \"$(git rev-parse HEAD^)\"\n '\n \n+test_expect_failure 'am correctly applies patch from email lacking \"From\" in first 3 lines' '\n+\tgit checkout first &&\n+\tgit am patch1.eml &&\n+\t! test -d .git/rebase-apply &&\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-- \n1.6.4\n"},{"id":"119857","messageId":"COrzR9ThNBy5SQ7chsXyUB30jVGIijxZQ3LI9L_y7Ab5vWcDcy_HolvjjuHTC7DHI9ntV-eR_v0@cipher.nrlssc.navy.mil","threadId":"20417","inReplyTo":"COrzR9ThNBy5SQ7chsXyUOUuBmX-VWMCz3MUVwvBOlIZzlIXRRMP6EMS7BRy_6uJvxt5H-FbtdY@cipher.nrlssc.navy.mil","subject":"[PATCH 2/3] mailinfo: allow individual e-mail files as input","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-08-07T01:08:12Z","receivedAt":"2009-08-07T01:08:12Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"From: Junio C Hamano <gitster@pobox.com>\n\nWe traditionally allowed a mbox file or a directory name of a maildir (but\nnever an individual file inside a maildir) to be given to \"git am\".  Even\nthough an individual file in a maildir (or more generally, a piece of\nRFC2822 e-mail) is not a mbox file, it contains enough information to\ncreate a commit out of it, so there is no reason to reject one.  Running\nmailsplit on such a file feels stupid, but it does not hurt.\n\nThis builds on top of a5a6755 (git-am foreign patch support: introduce\npatch_format, 2009-05-27) that introduced mailbox format detection.  The\ncodepath to deal with a mbox requires it to begin with \"From \" line and\nalso allows it to begin with \"From: \", but a random piece of e-mail can\nand often do begin with any valid RFC2822 header lines.\n\nInstead of checking the first line, we extract all the lines up to the\nfirst empty line, and make sure they look like e-mail headers.\n\nThis fixes the test in t4150-am.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Brandon Casey <drafnel@gmail.com>\n---\n\n\nJunio,\n\nYou'll notice that I changed your grep -E to an egrep and dropped the -e.\nI do not see any other grep which uses -e, and I seem to recall Jeff King\nactively removing -e claiming that some greps do not recognize it.  I do not\nhave a perfect memory though, so apologies to Jeff if I am mistaken.\n\n-brandon\n\n\n git-am.sh     |   14 ++++++++++++++\n t/t4150-am.sh |    2 +-\n 2 files changed, 15 insertions(+), 1 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex d64d997..dd60f5d 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -191,6 +191,20 @@ check_patch_format () {\n \t\t\tesac\n \t\t\t;;\n \t\tesac\n+\t\tif test -z \"$patch_format\" &&\n+\t\t\ttest -n \"$l1\" &&\n+\t\t\ttest -n \"$l2\" &&\n+\t\t\ttest -n \"$l3\"\n+\t\tthen\n+\t\t\t# This begins with three non-empty lines.  Is this a\n+\t\t\t# piece of e-mail a-la RFC2822?  Grab all the headers,\n+\t\t\t# discarding the indented remainder of folded lines,\n+\t\t\t# and see if it looks like that they all begin with the\n+\t\t\t# header field names...\n+\t\t\tsed -n -e '/^$/q' -e '/^[ \t]/d' -e p \"$1\" |\n+\t\t\tegrep -v '^[A-Za-z]+(-[A-Za-z]+)*:' >/dev/null ||\n+\t\t\tpatch_format=mbox\n+\t\tfi\n \t} < \"$1\" || clean_abort\n }\n \ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex ad2a85f..4e8e176 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -114,7 +114,7 @@ test_expect_success 'am applies patch correctly' '\n \ttest \"$(git rev-parse second^)\" = \"$(git rev-parse HEAD^)\"\n '\n \n-test_expect_failure 'am correctly applies patch from email lacking \"From\" in first 3 lines' '\n+test_expect_success 'am correctly applies patch from email lacking \"From\" in first 3 lines' '\n \tgit checkout first &&\n \tgit am patch1.eml &&\n \t! test -d .git/rebase-apply &&\n-- \n1.6.4\n"},{"id":"119859","messageId":"COrzR9ThNBy5SQ7chsXyUBcRjlQZ5mxjnQCmJLjctoPOo1ieWRAzuS-B2EZLAe3of_HNxTmt-ck@cipher.nrlssc.navy.mil","threadId":"20417","inReplyTo":"COrzR9ThNBy5SQ7chsXyUB30jVGIijxZQ3LI9L_y7Ab5vWcDcy_HolvjjuHTC7DHI9ntV-eR_v0@cipher.nrlssc.navy.mil","subject":"[PATCH 3/3] git-am: print fair error message when format detection fails","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-08-07T01:08:13Z","receivedAt":"2009-08-07T01:08:13Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"From: Nicolas Sebrecht <ni.s@laposte.net>\n\nAvoid git ending with this message:\n\t\"Patch format  is not supported.\"\n\nWith improved error message in the format detection failure case by\nGiuseppe Bilotta.\n\nSigned-off-by: Nicolas Sebrecht <ni.s@laposte.net>\nSigned-off-by: Brandon Casey <drafnel@gmail.com>\n---\n git-am.sh |    6 +++++-\n 1 files changed, 5 insertions(+), 1 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex dd60f5d..f719f6e 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -268,7 +268,11 @@ split_patches () {\n \t\tmsgnum=\n \t\t;;\n \t*)\n-\t\tclean_abort \"Patch format $patch_format is not supported.\"\n+\t\tif test -n \"$parse_patch\" ; then\n+\t\t\tclean_abort \"Patch format $patch_format is not supported.\"\n+\t\telse\n+\t\t\tclean_abort \"Patch format detection failed.\"\n+\t\tfi\n \t\t;;\n \tesac\n }\n-- \n1.6.4\n"},{"id":"119860","messageId":"20090807011820.GA16472@coredump.intra.peff.net","threadId":"20417","inReplyTo":"COrzR9ThNBy5SQ7chsXyUB30jVGIijxZQ3LI9L_y7Ab5vWcDcy_HolvjjuHTC7DHI9ntV-eR_v0@cipher.nrlssc.navy.mil","subject":"Re: [PATCH 2/3] mailinfo: allow individual e-mail files as input","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-08-07T01:18:20Z","receivedAt":"2009-08-07T01:18:20Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Aug 06, 2009 at 08:08:12PM -0500, Brandon Casey wrote:\n\n> You'll notice that I changed your grep -E to an egrep and dropped the -e.\n> I do not see any other grep which uses -e, and I seem to recall Jeff King\n> actively removing -e claiming that some greps do not recognize it.  I do not\n> have a perfect memory though, so apologies to Jeff if I am mistaken.\n\nFortunately git does have a perfect memory:\n\n  $ git log -1 --all-match --author=peff --grep=grep\n  commit 759ad19e772a79a2a5ae6b7377d57eb21d29e6a0\n  Author: Jeff King <peff@peff.net>\n  Date:   Wed Oct 22 15:22:53 2008 -0400\n\n      submodule: fix some non-portable grep invocations\n\n      Not all greps support \"-e\", but in this case we can easily\n      convert it to a single extended regex.\n\nThe grep in question is Solaris 8's /usr/bin/grep (which also needs\n\"egrep\" instead of \"-E\", as you already did).\n\n-Peff\n"},{"id":"119861","messageId":"mEqhWlw9LAyH0nh8YYU987gX5gaEeucbUmEtSnZRFab29VT4nc0amA@cipher.nrlssc.navy.mil","threadId":"20417","inReplyTo":"20090807011820.GA16472@coredump.intra.peff.net","subject":"Re: [PATCH 2/3] mailinfo: allow individual e-mail files as input","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-08-07T01:21:05Z","receivedAt":"2009-08-07T01:21:05Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Jeff King wrote:\n> On Thu, Aug 06, 2009 at 08:08:12PM -0500, Brandon Casey wrote:\n> \n>> You'll notice that I changed your grep -E to an egrep and dropped the -e.\n>> I do not see any other grep which uses -e, and I seem to recall Jeff King\n>> actively removing -e claiming that some greps do not recognize it.  I do not\n>> have a perfect memory though, so apologies to Jeff if I am mistaken.\n> \n> Fortunately git does have a perfect memory:\n\n:)\n"},{"id":"119862","messageId":"fmF7fF0TYh9QnFuUzmi-Zw9fKRhYn2-S-kCVb2e-d84D87BPqjfwrwFursOoLGkB99qKJmb_oRs@cipher.nrlssc.navy.mil","threadId":"20417","inReplyTo":"COrzR9ThNBy5SQ7chsXyUB30jVGIijxZQ3LI9L_y7Ab5vWcDcy_HolvjjuHTC7DHI9ntV-eR_v0@cipher.nrlssc.navy.mil","subject":"[PATCH v2] mailinfo: allow individual e-mail files as input","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-08-07T01:27:47Z","receivedAt":"2009-08-07T01:27:47Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"From: Junio C Hamano <gitster@pobox.com>\n\nWe traditionally allowed a mbox file or a directory name of a maildir (but\nnever an individual file inside a maildir) to be given to \"git am\".  Even\nthough an individual file in a maildir (or more generally, a piece of\nRFC2822 e-mail) is not a mbox file, it contains enough information to\ncreate a commit out of it, so there is no reason to reject one.  Running\nmailsplit on such a file feels stupid, but it does not hurt.\n\nThis builds on top of a5a6755 (git-am foreign patch support: introduce\npatch_format, 2009-05-27) that introduced mailbox format detection.  The\ncodepath to deal with a mbox requires it to begin with \"From \" line and\nalso allows it to begin with \"From: \", but a random piece of e-mail can\nand often do begin with any valid RFC2822 header lines.\n\nInstead of checking the first line, we extract all the lines up to the\nfirst empty line, and make sure they look like e-mail headers.\n\nThis fixes the test in t4150-am.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Brandon Casey <drafnel@gmail.com>\n---\n\n\nMaybe the second patch should be replaced with this one.  The original did\nnot test the first three lines for conformance to RFC2822.\n\n-brandon\n\n\n git-am.sh     |   19 +++++++++++++++++++\n t/t4150-am.sh |    2 +-\n 2 files changed, 20 insertions(+), 1 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex d64d997..49f2be4 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -191,6 +191,25 @@ check_patch_format () {\n \t\t\tesac\n \t\t\t;;\n \t\tesac\n+\t\tif test -z \"$patch_format\" &&\n+\t\t\ttest -n \"$l1\" &&\n+\t\t\ttest -n \"$l2\" &&\n+\t\t\ttest -n \"$l3\"\n+\t\tthen\n+\t\t\t# This begins with three non-empty lines.  Is this a\n+\t\t\t# piece of e-mail a-la RFC2822?  Grab all the headers,\n+\t\t\t# discarding the indented remainder of folded lines,\n+\t\t\t# and see if it looks like that they all begin with the\n+\t\t\t# header field names...\n+\t\t\t{\n+\t\t\t\techo \"$l1\"\n+\t\t\t\techo \"$l2\"\n+\t\t\t\techo \"$l3\"\n+\t\t\t\tcat\n+\t\t\t} | sed -n -e '/^$/q' -e '/^[ \t]/d' -e p \"$1\" |\n+\t\t\tegrep -v '^[A-Za-z]+(-[A-Za-z]+)*:' >/dev/null ||\n+\t\t\tpatch_format=mbox\n+\t\tfi\n \t} < \"$1\" || clean_abort\n }\n \ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex ad2a85f..4e8e176 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -114,7 +114,7 @@ test_expect_success 'am applies patch correctly' '\n \ttest \"$(git rev-parse second^)\" = \"$(git rev-parse HEAD^)\"\n '\n \n-test_expect_failure 'am correctly applies patch from email lacking \"From\" in first 3 lines' '\n+test_expect_success 'am correctly applies patch from email lacking \"From\" in first 3 lines' '\n \tgit checkout first &&\n \tgit am patch1.eml &&\n \t! test -d .git/rebase-apply &&\n-- \n1.6.4\n"},{"id":"119864","messageId":"20090807013650.GE12924@vidovic","threadId":"20417","inReplyTo":"COrzR9ThNBy5SQ7chsXyUB30jVGIijxZQ3LI9L_y7Ab5vWcDcy_HolvjjuHTC7DHI9ntV-eR_v0@cipher.nrlssc.navy.mil","subject":"[PATCH 2/3] Re: mailinfo: allow individual e-mail files as input","fromName":"Nicolas Sebrecht","fromEmail":"nicolas.s.dev@gmx.fr","sentAt":"2009-08-07T01:36:50Z","receivedAt":"2009-08-07T01:36:50Z","isPatch":true,"sender":{"key":"nicolas.s.dev@gmx.fr","avatar":null},"body":"The 06/08/09, Brandon Casey wrote:\n\n>  git-am.sh     |   14 ++++++++++++++\n>  t/t4150-am.sh |    2 +-\n>  2 files changed, 15 insertions(+), 1 deletions(-)\n> \n> diff --git a/git-am.sh b/git-am.sh\n> index d64d997..dd60f5d 100755\n> --- a/git-am.sh\n> +++ b/git-am.sh\n> @@ -191,6 +191,20 @@ check_patch_format () {\n>  \t\t\tesac\n>  \t\t\t;;\n>  \t\tesac\n> +\t\tif test -z \"$patch_format\" &&\n> +\t\t\ttest -n \"$l1\" &&\n> +\t\t\ttest -n \"$l2\" &&\n> +\t\t\ttest -n \"$l3\"\n> +\t\tthen\n> +\t\t\t# This begins with three non-empty lines.  Is this a\n> +\t\t\t# piece of e-mail a-la RFC2822?  Grab all the headers,\n> +\t\t\t# discarding the indented remainder of folded lines,\n> +\t\t\t# and see if it looks like that they all begin with the\n> +\t\t\t# header field names...\n> +\t\t\tsed -n -e '/^$/q' -e '/^[ \t]/d' -e p \"$1\" |\n> +\t\t\tegrep -v '^[A-Za-z]+(-[A-Za-z]+)*:' >/dev/null ||\n> +\t\t\tpatch_format=mbox\n> +\t\tfi\n>  \t} < \"$1\" || clean_abort\n>  }\n\nMay I ask why you resurrect this \"first three lines check for rfc2822\"\ninstead of dumbly falling back to the \"mbox\" patch_format? Performance?\n\n-- \nNicolas Sebrecht\n"},{"id":"119865","messageId":"20090807015238.GF12924@vidovic","threadId":"20417","inReplyTo":"fmF7fF0TYh9QnFuUzmi-Zw9fKRhYn2-S-kCVb2e-d84D87BPqjfwrwFursOoLGkB99qKJmb_oRs@cipher.nrlssc.navy.mil","subject":"[PATCH v2] Re: mailinfo: allow individual e-mail files as input","fromName":"Nicolas Sebrecht","fromEmail":"nicolas.s.dev@gmx.fr","sentAt":"2009-08-07T01:52:38Z","receivedAt":"2009-08-07T01:52:38Z","isPatch":true,"sender":{"key":"nicolas.s.dev@gmx.fr","avatar":null},"body":"The 06/08/09, Brandon Casey wrote:\n\n> diff --git a/git-am.sh b/git-am.sh\n> index d64d997..49f2be4 100755\n> --- a/git-am.sh\n> +++ b/git-am.sh\n\n<...>\n\n> +\t\t\t{\n> +\t\t\t\techo \"$l1\"\n> +\t\t\t\techo \"$l2\"\n> +\t\t\t\techo \"$l3\"\n> +\t\t\t\tcat\n\nUUOC, I guess.\n\n> +\t\t\t} | sed -n -e '/^$/q' -e '/^[ \t]/d' -e p \"$1\" |\n                                                   ^^\n\nIs it still needed?\n\n-- \nNicolas Sebrecht\n"},{"id":"119867","messageId":"20090807015628.GG12924@vidovic","threadId":"20417","inReplyTo":"20090807015238.GF12924@vidovic","subject":"[PATCH v2] Re: mailinfo: allow individual e-mail files as input","fromName":"Nicolas Sebrecht","fromEmail":"nicolas.s.dev@gmx.fr","sentAt":"2009-08-07T01:56:28Z","receivedAt":"2009-08-07T01:56:28Z","isPatch":true,"sender":{"key":"nicolas.s.dev@gmx.fr","avatar":null},"body":"The 07/08/09, Nicolas Sebrecht wrote:\n> The 06/08/09, Brandon Casey wrote:\n> \n> > diff --git a/git-am.sh b/git-am.sh\n> > index d64d997..49f2be4 100755\n> > --- a/git-am.sh\n> > +++ b/git-am.sh\n> \n> <...>\n> \n> > +\t\t\t{\n> > +\t\t\t\techo \"$l1\"\n> > +\t\t\t\techo \"$l2\"\n> > +\t\t\t\techo \"$l3\"\n> > +\t\t\t\tcat\n> \n> UUOC, I guess.\n> \n> > +\t\t\t} | sed -n -e '/^$/q' -e '/^[ \t]/d' -e p \"$1\" |\n>                                                    ^^\n\nOwned by the tabulation, sorry.\n\nDo we still need the \"$1\"?\n\n-- \nNicolas Sebrecht\n"},{"id":"119868","messageId":"Bq46oDu9ypgY1WI5GDyfybM5nluSMTj7VLfPqQH2BjK-xQyDLXAh5Q@cipher.nrlssc.navy.mil","threadId":"20417","inReplyTo":"20090807013650.GE12924@vidovic","subject":"Re: [PATCH 2/3] Re: mailinfo: allow individual e-mail files as input","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-08-07T01:59:05Z","receivedAt":"2009-08-07T01:59:05Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Nicolas Sebrecht wrote:\n> The 06/08/09, Brandon Casey wrote:\n> \n>>  git-am.sh     |   14 ++++++++++++++\n>>  t/t4150-am.sh |    2 +-\n>>  2 files changed, 15 insertions(+), 1 deletions(-)\n>>\n>> diff --git a/git-am.sh b/git-am.sh\n>> index d64d997..dd60f5d 100755\n>> --- a/git-am.sh\n>> +++ b/git-am.sh\n>> @@ -191,6 +191,20 @@ check_patch_format () {\n>>  \t\t\tesac\n>>  \t\t\t;;\n>>  \t\tesac\n>> +\t\tif test -z \"$patch_format\" &&\n>> +\t\t\ttest -n \"$l1\" &&\n>> +\t\t\ttest -n \"$l2\" &&\n>> +\t\t\ttest -n \"$l3\"\n>> +\t\tthen\n>> +\t\t\t# This begins with three non-empty lines.  Is this a\n>> +\t\t\t# piece of e-mail a-la RFC2822?  Grab all the headers,\n>> +\t\t\t# discarding the indented remainder of folded lines,\n>> +\t\t\t# and see if it looks like that they all begin with the\n>> +\t\t\t# header field names...\n>> +\t\t\tsed -n -e '/^$/q' -e '/^[ \t]/d' -e p \"$1\" |\n>> +\t\t\tegrep -v '^[A-Za-z]+(-[A-Za-z]+)*:' >/dev/null ||\n>> +\t\t\tpatch_format=mbox\n>> +\t\tfi\n>>  \t} < \"$1\" || clean_abort\n>>  }\n> \n> May I ask why you resurrect this \"first three lines check for rfc2822\"\n> instead of dumbly falling back to the \"mbox\" patch_format? Performance?\n\nThis at least checks that the header has the correct form for an email.\n\nThe dumb fallback to mbox format would just blindly pass the patch to\nmailsplit which (I think) would just dump out an improperly formatted\nemail.  git-am would then start the process of applying the malformed\npatch and fail.  With this patch, we can catch the failure earlier\nand hopefully provide a better complaint to the user.\n\n-brandon\n"},{"id":"119869","messageId":"4Frzb2o8m7o4sjOhlZiN-mXQHUAsXYeImlNxZ8ANJZ5I3_S_JjSsoA@cipher.nrlssc.navy.mil","threadId":"20417","inReplyTo":"20090807015628.GG12924@vidovic","subject":"Re: [PATCH v2] Re: mailinfo: allow individual e-mail files as input","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-08-07T02:05:26Z","receivedAt":"2009-08-07T02:05:26Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Nicolas Sebrecht wrote:\n> The 07/08/09, Nicolas Sebrecht wrote:\n>> The 06/08/09, Brandon Casey wrote:\n>>\n>>> diff --git a/git-am.sh b/git-am.sh\n>>> index d64d997..49f2be4 100755\n>>> --- a/git-am.sh\n>>> +++ b/git-am.sh\n>> <...>\n>>\n>>> +\t\t\t{\n>>> +\t\t\t\techo \"$l1\"\n>>> +\t\t\t\techo \"$l2\"\n>>> +\t\t\t\techo \"$l3\"\n>>> +\t\t\t\tcat\n>> UUOC, I guess.\n>>\n>>> +\t\t\t} | sed -n -e '/^$/q' -e '/^[ \t]/d' -e p \"$1\" |\n>>                                                    ^^\n> \n> Owned by the tabulation, sorry.\n> \n> Do we still need the \"$1\"?\n\nWhoops, I missed that \"$1\" argument to sed.  That means the v2 followup\npatch is unnecessary since the sed is operating on a file argument\nand _not_ stdin.  I think it's a little strange like that though...\n\n   {\n      sed \"$1\"\n   } < \"$1\"\n\n-brandon\n"},{"id":"119871","messageId":"kRgAbadymu_kXO_N6eQZL3RZpkCM95QJxM7bDH84bRuxk2kjGYKwjA@cipher.nrlssc.navy.mil","threadId":"20417","inReplyTo":"20090807015238.GF12924@vidovic","subject":"Re: [PATCH v2] Re: mailinfo: allow individual e-mail files as input","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-08-07T02:30:30Z","receivedAt":"2009-08-07T02:30:30Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Nicolas Sebrecht wrote:\n> The 06/08/09, Brandon Casey wrote:\n> \n>> diff --git a/git-am.sh b/git-am.sh\n>> index d64d997..49f2be4 100755\n>> --- a/git-am.sh\n>> +++ b/git-am.sh\n> \n> <...>\n> \n>> +\t\t\t{\n>> +\t\t\t\techo \"$l1\"\n>> +\t\t\t\techo \"$l2\"\n>> +\t\t\t\techo \"$l3\"\n>> +\t\t\t\tcat\n> \n> UUOC, I guess.\n\nI needed to use google to figure out that UUOC means Useless Use Of Cat,\nbut I think you are mistaken.  Rather than trying to explain it, try this\nwith and without 'cat' commented out:\n\n#!/bin/sh\n\n{\n    {\n        echo \"line one\"\n        echo \"line two\"\n        cat\n    } | sed -e 's/$/Q/'\n} <<-EOF\nThis is a line of text\nHere is another line of text.\nAnd another\nEOF\n\nHopefully you'll see the parallels to the sequence in git-am.sh and understand\nthat cat was used to send the rest of the email through sed along with the first\nthree lines that were read explicitly.  git-am.sh looks more like this:\n\n   {\n      read l1\n      ...\n      {\n         echo \"$l1\"\n         ...\n         cat\n      } | sed ...\n   } << \"$1\"\n\nAt least, I thought that is how it looked until I read your other email where\nyou pointed out that \"$1\" is an argument to sed.\n\n>> +\t\t\t} | sed -n -e '/^$/q' -e '/^[ \t]/d' -e p \"$1\" |\n>                                                    ^^\n> \n> Is it still needed?\n\nYes.  The '/^[ \t]/d' portion of the sed statement deletes any lines with\nleading space or tab.  This avoids passing continuation fields to the\ngrep statement which is not designed for them, and so would fail (or\nmatch, depending on how you look at it.  We used -v with grep).\n\n-brandon\n"},{"id":"119872","messageId":"20090807023126.GH12924@vidovic","threadId":"20417","inReplyTo":"4Frzb2o8m7o4sjOhlZiN-mXQHUAsXYeImlNxZ8ANJZ5I3_S_JjSsoA@cipher.nrlssc.navy.mil","subject":"[PATCH v2] Re: mailinfo: allow individual e-mail files as input","fromName":"Nicolas Sebrecht","fromEmail":"nicolas.s.dev@gmx.fr","sentAt":"2009-08-07T02:31:26Z","receivedAt":"2009-08-07T02:31:26Z","isPatch":true,"sender":{"key":"nicolas.s.dev@gmx.fr","avatar":null},"body":"The 06/08/09, Brandon Casey wrote:\n\n> Whoops, I missed that \"$1\" argument to sed.  That means the v2 followup\n> patch is unnecessary since the sed is operating on a file argument\n> and _not_ stdin.\n\nYes.\n\n>                   I think it's a little strange like that though...\n> \n>    {\n>       sed \"$1\"\n>    } < \"$1\"\n\nI'm not sure why this comment. The former\n\n  sed \"$1\"\n\nwhithout anything else is enough.\n\n-- \nNicolas Sebrecht\n"},{"id":"119874","messageId":"7GvFnE4br-8WnXmtoea9V1LPY-qshCw6arPr6H40SRG59-b7YcpTsw@cipher.nrlssc.navy.mil","threadId":"20417","inReplyTo":"20090807023126.GH12924@vidovic","subject":"Re: [PATCH v2] Re: mailinfo: allow individual e-mail files as input","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2009-08-07T02:49:06Z","receivedAt":"2009-08-07T02:49:06Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Nicolas Sebrecht wrote:\n> The 06/08/09, Brandon Casey wrote:\n>>                   I think it's a little strange like that though...\n>>\n>>    {\n>>       sed \"$1\"\n>>    } < \"$1\"\n> \n> I'm not sure why this comment. The former\n> \n>   sed \"$1\"\n> \n> whithout anything else is enough.\n\nThe \"former\", or Junio's original patch, effectively has this form:\n\n   {\n      sed \"$1\"\n   } < \"$1\"\n\nWithout reading closely enough, I thought it looked like this:\n\n   {\n      sed\n   } < \"$1\"\n\nSince I didn't study the sed statement closely enough, I assumed that it was\noperating on the remaining portion of the patch email that was redirected to\nthe block on stdin.  I missed the fact that the file name was supplied to\nit.  My comment was that I found it strange (and maybe unintuitive, or maybe\nit's just me) that \"$1\" was piped on stdin and it was supplied as an\nargument to sed.\n\n-brandon\n"},{"id":"119877","messageId":"20090807123346.6117@nanako3.lavabit.com","threadId":"20417","inReplyTo":"MEhvdM_GHnyaFj9ZU3lxKS47vmOk5BKslGm0FxkE_lg0SQT5Zx6KhA@cipher.nrlssc.navy.mil","subject":"Re: What's in git.git (Aug 2009, #01; Wed, 05)","fromName":"Nanako Shiraishi","fromEmail":"nanako3@lavabit.com","sentAt":"2009-08-07T03:33:46Z","receivedAt":"2009-08-07T03:33:46Z","isPatch":false,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"Quoting Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil>\n\n> Junio C Hamano wrote:\n>> The 1.6.4 release seems to have been quite solid, and there is no\n>> brown-paper-bag bugfixes on 'maint' yet ;-).\n>\n> Found one.\n>\n> I didn't realize the whole git-am discussion did _not_ result in a\n> fix being applied.  But git-am will currently refuse to apply any\n> patch from email that does not have \"From \" or \"From: \" in the first\n> three lines of the email.  For those of us whose mail servers prepend\n> many lines of the form:\n>\n> Received: from XXX ([XXX]) by XXX with Microsoft SMTPSVC(6.0.3790.2825);\n> \t Tue, 14 Jul 2009 07:24:06 -0500\n\nAccording to an already hashed out discussion, that isn't a mbox format that has been supported, so it isn't even a bug. For details, see e.g.\n\n    http://thread.gmane.org/gmane.comp.version-control.git/123338/focus=123355\n\nAnd Nicolas Sebrecht has been working with Junio to implement an enhancement to add support for the \"individual piece of email\" format.\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n"},{"id":"119878","messageId":"7vhbwk8fb8.fsf@alter.siamese.dyndns.org","threadId":"20417","inReplyTo":"COrzR9ThNBy5SQ7chsXyUB30jVGIijxZQ3LI9L_y7Ab5vWcDcy_HolvjjuHTC7DHI9ntV-eR_v0@cipher.nrlssc.navy.mil","subject":"Re: [PATCH 2/3] mailinfo: allow individual e-mail files as input","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-07T03:37:31Z","receivedAt":"2009-08-07T03:37:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <casey@nrlssc.navy.mil> writes:\n\n> You'll notice that I changed your grep -E to an egrep and dropped the -e.\n\nThat's the right thing to do.  I was re-reading Nicolas Sebrecht's series\nand checked with  \"git grep -e 'egrep ' -e 'grep .*-E '\" to reach the same\nconclusion.  Thanks.\n"},{"id":"119879","messageId":"7v3a848ehq.fsf@alter.siamese.dyndns.org","threadId":"20417","inReplyTo":"20090807123346.6117@nanako3.lavabit.com","subject":"Re: What's in git.git (Aug 2009, #01; Wed, 05)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-07T03:55:13Z","receivedAt":"2009-08-07T03:55:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nanako Shiraishi <nanako3@lavabit.com> writes:\n\n> And Nicolas Sebrecht has been working with Junio to implement an\n> enhancement to add support for the \"individual piece of email\" format.\n\nI'll squash patches 1+2/3 from Brandon into a single change after\nretitling it to read \"am\" not \"mailinfo\", and queue the result, together\nwith patch 3/3.\n\nThanks, Brandon and Nicolas.\n"},{"id":"119883","messageId":"20090807043929.GJ12924@vidovic","threadId":"20417","inReplyTo":"7GvFnE4br-8WnXmtoea9V1LPY-qshCw6arPr6H40SRG59-b7YcpTsw@cipher.nrlssc.navy.mil","subject":"[PATCH v2] Re: mailinfo: allow individual e-mail files as input","fromName":"Nicolas Sebrecht","fromEmail":"nicolas.s.dev@gmx.fr","sentAt":"2009-08-07T04:39:29Z","receivedAt":"2009-08-07T04:39:29Z","isPatch":true,"sender":{"key":"nicolas.s.dev@gmx.fr","avatar":null},"body":"The 06/08/09, Brandon Casey wrote:\n\n> The \"former\", or Junio's original patch, effectively has this form:\n> \n>    {\n>       sed \"$1\"\n>    } < \"$1\"\n> \n> Without reading closely enough, I thought it looked like this:\n> \n>    {\n>       sed\n>    } < \"$1\"\n> \n> Since I didn't study the sed statement closely enough, I assumed that it was\n> operating on the remaining portion of the patch email that was redirected to\n> the block on stdin.  I missed the fact that the file name was supplied to\n> it.  My comment was that I found it strange (and maybe unintuitive, or maybe\n> it's just me) that \"$1\" was piped on stdin and it was supplied as an\n> argument to sed.\n\nThinking to this a bit more, I tend to think that your intention to get\nrid of the \"$1\" argument of sed is the right thing to do.\n\nIt really seems like the argument has precedence to the redirection\n\n  _but_\n\nI couldn't find any reference to this case in POSIX and I guess that the\nbehaviour may differ between implementations of sed. I don't know.\nPerhaps somebody could tell us if our hesitation is justified (or not)?\n\nFinally and to prevent strange behaviours, I would write\n\n  {\n    real l1\n    real l2\n    real l3\n    {\n      echo \"$l1\"\n      echo \"$l2\"\n      echo \"$l3\"\n      cat\n    } | sed\n  } < \"$1\"\n\ninstead of\n\n  {\n    real l1\n    real l2\n    real l3\n    sed \"$1\"\n  } < \"$1\"\n\nbecause the latter may contain either the content of the whole file\n(coming from the argument) or the content of the file _whithout_ the\nfirst three lines (coming from the redirection '<' amputated by the\n'read' statements).\n\nJunio?\n\n-- \nNicolas Sebrecht\n"},{"id":"119888","messageId":"7vtz0k5h64.fsf@alter.siamese.dyndns.org","threadId":"20417","inReplyTo":"20090807043929.GJ12924@vidovic","subject":"Re: [PATCH v2] Re: mailinfo: allow individual e-mail files as input","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-07T05:25:39Z","receivedAt":"2009-08-07T05:25:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nicolas Sebrecht <nicolas.s.dev@gmx.fr> writes:\n\n> It really seems like the argument has precedence to the redirection\n> I couldn't find any reference to this case in POSIX and I guess that the\n> behaviour may differ between implementations of sed.\n> Perhaps somebody could tell us if our hesitation is justified (or not)?\n\nIf you give file arguments, standard input is irrelevant to sed.  I bet you\ndo:\n\n\t$ sed -e something file\n\nall the time, and you rely on the command not to get stuck after reading\nthe file because now it wants to continue reading from its stdin, which is\nconnected to your terminal.  Have you ever worried about having to type ^D\nafter every such invocation of sed?  I bet you never have ;-)\n\nAlso, your _preferred_ alternative\n\n\t{ read l1; read l2; read l3;\n          ( echo \"$l1\"; echo \"$l2\"; echo \"$l3\"; cat | sed )\n\t} <\"$1\"\n\nis not just simply inefficient, but is actively wrong.  The \"read\" can\nbutcher your input.  For example, try:\n\n\t$ echo \"a b \" | ( read l1; echo \"<$l1>\" )\n"},{"id":"119904","messageId":"dSTzkQzxc8zstXelCsOfpeKtZA6klAYAoFqmV5dstEQ@cipher.nrlssc.navy.mil","threadId":"20417","inReplyTo":"20090807123346.6117@nanako3.lavabit.com","subject":"Re: What's in git.git (Aug 2009, #01; Wed, 05)","fromName":"Brandon Casey","fromEmail":"brandon.casey.ctr@nrlssc.navy.mil","sentAt":"2009-08-07T14:01:43Z","receivedAt":"2009-08-07T14:01:43Z","isPatch":false,"sender":{"key":"brandon.casey.ctr@nrlssc.navy.mil","avatar":null},"body":"Nanako Shiraishi wrote:\n> Quoting Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil>\n> \n>> Junio C Hamano wrote:\n>>> The 1.6.4 release seems to have been quite solid, and there is no\n>>> brown-paper-bag bugfixes on 'maint' yet ;-).\n>> Found one.\n>>\n>> I didn't realize the whole git-am discussion did _not_ result in a\n>> fix being applied.  But git-am will currently refuse to apply any\n>> patch from email that does not have \"From \" or \"From: \" in the first\n>> three lines of the email.  For those of us whose mail servers prepend\n>> many lines of the form:\n>>\n>> Received: from XXX ([XXX]) by XXX with Microsoft SMTPSVC(6.0.3790.2825);\n>> \t Tue, 14 Jul 2009 07:24:06 -0500\n> \n> According to an already hashed out discussion, that isn't a mbox format that has been supported, so it isn't even a bug. For details, see e.g.\n> \n>     http://thread.gmane.org/gmane.comp.version-control.git/123338/focus=123355\n> \n> And Nicolas Sebrecht has been working with Junio to implement an enhancement to add support for the \"individual piece of email\" format.\n\nCommit b3f041fb0f7de167dbb6711b0a231d36c4b5de08 titled 'git-am support for\nnaked email messages (take 2)' by H. Peter Anvin from December 2005 seems\nto indicate otherwise.\n\nIMHO, I think something was indeed broken here, but it is a moot point\nsince it will all be fixed (or \"enhanced\" depending on your POV) soon. :)\n\n-brandon\n"}]}