Re: [PATCH] git-am --one

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] git-am --one

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:14

"H. Peter Anvin" [off-list ref] writes:
Junio C Hamano wrote:
quoted
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
If that works, great.  I just implemented it in the "most obviously 
correct" way, meaning with as few changes as possible.
Another thing you may probably want is to loop over "$@", so
that the flag is not --one anymore, but --2822 (or --bare as
opposed to mbox format) and do something like this:

	case "$series_of_2822_messages" in
        '') ... original code ... ;;
        *)
        	i=1
                for input
                do
			this=`printf "%${prec}d" $i
                        cp "$input" "$dotest/$this"
                        i=$(($i+1))
		done
                printf "%${prec}d" $# >"$dotest/last"
                ;;
	esac

Re: [PATCH] git-am --one

From: "H. Peter Anvin" <hpa@zytor.com>
Date: 2016-06-15 22:42:14

Junio C Hamano wrote:
Another thing you may probably want is to loop over "$@", so
that the flag is not --one anymore, but --2822 (or --bare as
opposed to mbox format) and do something like this:

	case "$series_of_2822_messages" in
        '') ... original code ... ;;
        *)
        	i=1
                for input
                do
			this=`printf "%${prec}d" $i
                        cp "$input" "$dotest/$this"
                        i=$(($i+1))
		done
                printf "%${prec}d" $# >"$dotest/last"
                ;;
	esac
That is definitely a good idea.  I'll mess with it a bit.

	-hpa
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help