From: Junio C Hamano <junkio@cox.net>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-am --one
Date: Tue, 13 Dec 2005 17:30:59 -0800 [thread overview]
Message-ID: <7vy82o5uss.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <439F7105.9050302@zytor.com> (H. Peter Anvin's message of "Tue, 13 Dec 2005 17:10:29 -0800")
"H. Peter Anvin" <hpa@zytor.com> writes:
> This patch adds the --one (-o) option to git-am, to apply a single
> message in RFC 2822 format, as opposed to an mbox. With some MUAs it's
> a lot easier to save individual messages than with mboxes, and either
> way the user may want to control the ordering if there are known
> interdependencies.
> + # standard input. To prepend the header, we thus want a
> + # second cat, sigh...
> + if test "$one" = t
> + then
> + LANG=C date +'From - %a %b %d %T %Y' > "$dotest"/fakefrom
> + fakefrom="$dotest"/fakefrom
> + else
> + fakefrom=/dev/null
> + fi
> + cat "$@" | cat "$fakefrom" - |
> git-mailsplit -d$prec "$dotest/" >"$dotest/last" || {
> rm -fr "$dotest"
> exit 1
I understand the motivation, but I suspect skipping mailsplit
might be simpler, like this untested code perhaps?
case "$one" in
'')
... original code ...
;;
*)
one=`printf "%${prec}d" 1`
cat "$@" >"$dotest/$one"
echo "$one" >"$dotest/last"
;;
esac
next prev parent reply other threads:[~2005-12-14 1:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-14 1:10 [PATCH] git-am --one H. Peter Anvin
2005-12-14 1:30 ` Junio C Hamano [this message]
2005-12-14 1:47 ` H. Peter Anvin
2005-12-14 1:54 ` Junio C Hamano
2005-12-14 1:58 ` H. Peter Anvin
2005-12-14 2:06 ` Junio C Hamano
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=7vy82o5uss.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=hpa@zytor.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).