git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Sebrecht <nicolas.s.dev@gmx.fr>
To: Brandon Casey <casey@nrlssc.navy.mil>
Cc: gitster@pobox.com, giuseppe.bilotta@gmail.com,
	git@vger.kernel.org, Brandon Casey <drafnel@gmail.com>
Subject: [PATCH 2/3] Re: mailinfo: allow individual e-mail files as input
Date: Fri, 7 Aug 2009 03:36:50 +0200	[thread overview]
Message-ID: <20090807013650.GE12924@vidovic> (raw)
In-Reply-To: <COrzR9ThNBy5SQ7chsXyUB30jVGIijxZQ3LI9L_y7Ab5vWcDcy_HolvjjuHTC7DHI9ntV-eR_v0@cipher.nrlssc.navy.mil>

The 06/08/09, Brandon Casey wrote:

>  git-am.sh     |   14 ++++++++++++++
>  t/t4150-am.sh |    2 +-
>  2 files changed, 15 insertions(+), 1 deletions(-)
> 
> diff --git a/git-am.sh b/git-am.sh
> index d64d997..dd60f5d 100755
> --- a/git-am.sh
> +++ b/git-am.sh
> @@ -191,6 +191,20 @@ check_patch_format () {
>  			esac
>  			;;
>  		esac
> +		if test -z "$patch_format" &&
> +			test -n "$l1" &&
> +			test -n "$l2" &&
> +			test -n "$l3"
> +		then
> +			# This begins with three non-empty lines.  Is this a
> +			# piece of e-mail a-la RFC2822?  Grab all the headers,
> +			# discarding the indented remainder of folded lines,
> +			# and see if it looks like that they all begin with the
> +			# header field names...
> +			sed -n -e '/^$/q' -e '/^[ 	]/d' -e p "$1" |
> +			egrep -v '^[A-Za-z]+(-[A-Za-z]+)*:' >/dev/null ||
> +			patch_format=mbox
> +		fi
>  	} < "$1" || clean_abort
>  }

May I ask why you resurrect this "first three lines check for rfc2822"
instead of dumbly falling back to the "mbox" patch_format? Performance?

-- 
Nicolas Sebrecht

  parent reply	other threads:[~2009-08-07  1:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-05 22:04 What's in git.git (Aug 2009, #01; Wed, 05) Junio C Hamano
2009-08-06 22:24 ` Brandon Casey
2009-08-06 23:17   ` Nicolas Sebrecht
2009-08-06 23:28     ` Nicolas Sebrecht
2009-08-07  1:08   ` [PATCH 1/3] t4150-am: demonstrate git-am's failure to handle some patch emails Brandon Casey
2009-08-07  1:08     ` [PATCH 2/3] mailinfo: allow individual e-mail files as input Brandon Casey
2009-08-07  1:08       ` [PATCH 3/3] git-am: print fair error message when format detection fails Brandon Casey
2009-08-07  1:18       ` [PATCH 2/3] mailinfo: allow individual e-mail files as input Jeff King
2009-08-07  1:21         ` Brandon Casey
2009-08-07  1:27       ` [PATCH v2] " Brandon Casey
2009-08-07  1:52         ` [PATCH v2] " Nicolas Sebrecht
2009-08-07  1:56           ` Nicolas Sebrecht
2009-08-07  2:05             ` Brandon Casey
2009-08-07  2:31               ` Nicolas Sebrecht
2009-08-07  2:49                 ` Brandon Casey
2009-08-07  4:39                   ` Nicolas Sebrecht
2009-08-07  5:25                     ` Junio C Hamano
2009-08-07  2:30           ` Brandon Casey
2009-08-07  1:36       ` Nicolas Sebrecht [this message]
2009-08-07  1:59         ` [PATCH 2/3] " Brandon Casey
2009-08-07  3:37       ` [PATCH 2/3] " Junio C Hamano
2009-08-07  3:33   ` What's in git.git (Aug 2009, #01; Wed, 05) Nanako Shiraishi
2009-08-07  3:55     ` Junio C Hamano
2009-08-07 14:01     ` Brandon Casey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090807013650.GE12924@vidovic \
    --to=nicolas.s.dev@gmx.fr \
    --cc=casey@nrlssc.navy.mil \
    --cc=drafnel@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=giuseppe.bilotta@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).