From: Junio C Hamano Date: Wed, 14 Dec 2005 01:30:59 GMT Subject: Re: [PATCH] git-am --one Message-ID: <7vy82o5uss.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <439F7105.9050302@zytor.com> "H. Peter Anvin" 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