From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCHv2 3/4] git-am foreign patch support: StGIT support
Date: Wed, 27 May 2009 10:29:06 +0200 [thread overview]
Message-ID: <cb7bb73a0905270129j375ac104yb9ca8601312ddbde@mail.gmail.com> (raw)
In-Reply-To: <7v7i03j9mb.fsf@alter.siamese.dyndns.org>
On Wed, May 27, 2009 at 9:19 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:
>
>> + # set the patch format appropriately
>> + patch_format=stgit
>> + # now handle the actual StGIT patches
>> + split_patches "$@"
>
> Can an stgit patch file (or the leading pathname for that matter) have IFS
> character in its name?
StGIT sanitizes filenames in a way similar to what format-patch does.
>> + ;;
>> + stgit)
>> + this=0
>> + for stgit in "$@"
>> + do
>> + this=`expr "$this" + 1`
>> + msgnum=`printf "%0${prec}d" $this`
>> + touch "$dotest/$msgnum"
>
> Portability tip from an old timer: do not create a new empty file with
> "touch" (only use that command to update the timestamp of an existing
> file).
>
> Instead say
>
> >"$dotest/$msgnum"
>
>> + # Awk version of StGIT parse_patch. The first nonemptyline
>> + # not starting with Author, From or Date is the
>> + # subject, and the body starts with the next nonempty
>> + # line not starting with Author, From or Date
>> + awk 'BEGIN { subject=0 }
>> + {
>> + if (subject > 1)
>> + print ;
>> + else if (/^$/) next ;
>> + else if (/^Author:/) print sub("Author", "From"), $ORS ;
>
> Can any token that match Author other than the initial "Author: " appear
> on this line?
Irrelevant, sub only substitutes the first hit so only the initial
Author: is replaced.
> Since we rely on Perl but not awk in core-ish part of the scripted
> Porcelains, it might be a good idea to write this in Perl as well.
By 'as well' you mean in case awk is missing, and have both, or by
only keeping a perl version?
--
Giuseppe "Oblomov" Bilotta
next prev parent reply other threads:[~2009-05-27 8:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-26 0:38 [PATCHv2 0/4] git-am support for foreign patches Giuseppe Bilotta
2009-05-26 0:38 ` [PATCHv2 1/4] git-am foreign patch support: introduce patch_format Giuseppe Bilotta
2009-05-26 0:38 ` [PATCHv2 2/4] git-am foreign patch support: autodetect some patch formats Giuseppe Bilotta
2009-05-26 0:38 ` [PATCHv2 3/4] git-am foreign patch support: StGIT support Giuseppe Bilotta
2009-05-26 0:38 ` [PATCHv2 4/4] git-am: refactor 'cleaning up and aborting' Giuseppe Bilotta
2009-05-27 7:19 ` Junio C Hamano
2009-05-27 7:19 ` [PATCHv2 3/4] git-am foreign patch support: StGIT support Junio C Hamano
2009-05-27 8:29 ` Giuseppe Bilotta [this message]
2009-05-27 20:50 ` Junio C Hamano
2009-05-27 7:19 ` [PATCHv2 2/4] git-am foreign patch support: autodetect some patch formats Junio C Hamano
2009-05-27 8:19 ` Giuseppe Bilotta
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=cb7bb73a0905270129j375ac104yb9ca8601312ddbde@mail.gmail.com \
--to=giuseppe.bilotta@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).