git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Sebrecht <nicolas.s.dev@gmx.fr>
To: Nicolas Sebrecht <nicolas.s.dev@gmx.fr>
Cc: Junio C Hamano <gitster@pobox.com>,
	Stephen Boyd <bebarino@gmail.com>,
	git@vger.kernel.org
Subject: [PATCH v5] Re: git-am: allow e-mail file(s) as input
Date: Thu, 16 Jul 2009 10:06:57 +0200	[thread overview]
Message-ID: <20090716080657.GJ12971@vidovic> (raw)
In-Reply-To: <20090716075055.GI12971@vidovic>

The 16/07/09, Nicolas Sebrecht wrote:
> The 16/07/09, Junio C Hamano wrote:
> > Stephen Boyd <bebarino@gmail.com> writes:
> > > Nicolas Sebrecht wrote:
> > 
> > >> +	# Then, accept what really looks like (series of) email(s).
> > >> +	# the first sed select headers but the folded ones
> > >> +	sed -e '/^$/q' -e '/^[[:blank:]]/d' "$1" |
> > >> +	# this one is necessary for the next 'grep -v'
> > >> +	sed -e '/^$/d' |
> > >> +	grep -v -E -e '^[A-Za-z]+(-[A-Za-z]+)*:' ||
> > >> +	{
> > >> +		patch_format=mbox
> > >> +		return 0
> > >> +	}
> > >> +
> > >>  	# otherwise, check the first few lines of the first patch to try
> > >>  	# to detect its format
> > >>  	{
> > >
> > > This fails t4150-am.sh #10 (am -3 -q is quiet). You should redirect the
> > > output of the sed and grep to /dev/null like Junio did in his "how about
> > > this" patch.
> 
> Thank you.
> 
> > Honestly speaking, I do not understand why Nicolas changed my patch at
> > all.
> > 
> > This patch wastes an extra sed process
> 
> Should we really worry about that in a script like git-am.sh? I mean,
> does it matter in a day to day work?

Oh I've forgotten, yes we need it: sed -e '/^$/q' leaves this matching
line to the output. An extra CRLF makes 'grep -v' fail.

> >                                         introduces [[:blank::]] where
> > space and tab inside [] is perfectly adequate, and we know the latter is
> > understood by everybody's sed.
> 
> But is harder to read in editors.
> 
> > The worst part is that this check was moved before the most common case of
> > mbox file for which none of the overhead for this this extra processing is
> > necessary.
> 
> Well, I did this move just because of the logical structure of the code.
> That said, you're right about the overhead.

-- 
Nicolas Sebrecht

  reply	other threads:[~2009-07-16  8:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-15 22:19 [PATCH v3] git-am: fix maildir support regression: accept email file as patch Nicolas Sebrecht
2009-07-15 22:43 ` [PATCH v3] " Nicolas Sebrecht
2009-07-15 22:54 ` [PATCH v3] " Junio C Hamano
2009-07-15 23:56   ` Junio C Hamano
2009-07-16  1:00     ` [PATCH v3] " Nicolas Sebrecht
2009-07-16  2:06       ` Nicolas Sebrecht
2009-07-16  2:30       ` Junio C Hamano
2009-07-16  2:59         ` Nicolas Sebrecht
2009-07-16  0:49   ` Nicolas Sebrecht
2009-07-16  2:41     ` Junio C Hamano
2009-07-16  4:05       ` [PATCH v4] git-am: allow e-mail file(s) as input Nicolas Sebrecht
2009-07-16  4:10         ` [PATCH v4] " Nicolas Sebrecht
2009-07-16  5:23       ` [PATCH v5] " Nicolas Sebrecht
2009-07-16  7:09         ` Stephen Boyd
2009-07-16  7:24           ` Junio C Hamano
2009-07-16  7:50             ` [PATCH v5] " Nicolas Sebrecht
2009-07-16  8:06               ` Nicolas Sebrecht [this message]
2009-07-16  8:17                 ` Johannes Sixt
2009-07-16  8:12               ` Johannes Sixt
2009-07-16 17:45             ` [PATCH v6] mailinfo: allow e-mail files " Nicolas Sebrecht
2009-07-17  1:05               ` Junio C Hamano
2009-07-17  2:20                 ` [PATCH v6] " Nicolas Sebrecht
2009-07-17 10:06               ` [PATCH v6] " Nanako Shiraishi
2009-07-17 19:54                 ` Junio C Hamano
2009-07-17 22:04                   ` [PATCH v6] " Nicolas Sebrecht
2009-08-06 17:07                     ` [PATCH v7] " Nicolas Sebrecht

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=20090716080657.GJ12971@vidovic \
    --to=nicolas.s.dev@gmx.fr \
    --cc=bebarino@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).