Re: [PATCH] git-am --one

From: Junio C Hamano <junkio@cox.net>
Date: 2005-12-14 12:30:59
"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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed Dec 14 12:31:36 2005

This archive was generated by hypermail 2.1.8 : 2005-12-14 12:31:43 EST