From: Luben Tuikov Date: Tue, 22 Nov 2005 06:26:19 GMT Subject: Re: [RFC] git-format-patch options Message-ID: <20051122062619.97432.qmail@web31810.mail.mud.yahoo.com> In-Reply-To: <7vhda5ssxb.fsf@assigned-by-dhcp.cox.net> --- Junio C Hamano wrote: > > The case statement that follows that comment is not quite right, > BTW. "format-patch foo bar..baz" should mean sequence of "foo" > and then "bar..baz", but it incorrectly translates to a > malformed "foo..bar..baz". > > Modulo that bug, what the current code does is to special case > one or two arguments case and rewrite them in that case > statement, and then iterate over the resulting "$@". We barf if > each 'revpair' is not in rev1..rev2 format. > > But it might make sense to (still keeping the above three > backward compatibility syntax exceptions) interpret "rev" to > mean "rev^1..rev", like this: Ok, I don't understand the patch below. I tried to get from "rev" to a "rev^1..rev" or the identical "rev^1 rev", but could never do it with git-format-patch. So for now I just use the "rev^1..rev". BTW, here is the analogy: git-diff-tree --pretty=raw -p does what I want, except that it is not in patch format as expected. So it is quite possible to just add a command line parameter to git-diff-tree to indicate "formatted patch output", and we're done. Luben > > --- > > diff --git a/git-format-patch.sh b/git-format-patch.sh > index 7ee5d32..351790c 100755 > --- a/git-format-patch.sh > +++ b/git-format-patch.sh > @@ -99,7 +99,7 @@ filelist=$tmp-files > # Also, "rev1.." should mean "rev1..HEAD"; git-diff users are > # familiar with that syntax. > > -case "$#,$1" in > +case "$#,$1$2" in > 1,?*..?*) > # single "rev1..rev2" > ;; > @@ -131,7 +131,8 @@ do > rev2=`expr "$revpair" : '.*\.\.\(.*\)'` > ;; > *) > - usage > + rev1="$revpair^" > + rev2="$revpair" > ;; > esac > git-rev-parse --verify "$rev1^0" >/dev/null 2>&1 || > > > > - > 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 >