Subject: Re: [PATCH] git send-email: allow any rev-list option as an argument.

From: Pierre Habouzit <[email-masked]>
Date: Tue, 04 Nov 2008 09:19:31 +0100

On Tue, Nov 04, 2008 at 01:04:27AM +0000, Junio C Hamano wrote:
> Pierre Habouzit <[email-masked]> writes:
> 
> > As a summary, I'd say that I like both (1) and (3) because those are
> > handy, short, and either completely or mostly backward compatible. My
> > way would be to go down (1) and add a alias.s-e = !git send-email -F in
> > my .gitconfig.
> >
> > What do you think ?
> 
> I wonder if we can do this even without an explicit -F.
> 
> What command line arguments does send-email take, and what options would
> we want to give the underlying format-patch?  Can't you sift them without
> ambiguity?
> 
> The current syntax is:
> 
>     git send-email <flags>... <file|dir>...
> 
> I am wondering if we can just extend it to:
> 
>     git send-email <flags>... <<file|dir>...|rev>
> 
> E.g. we should be able to parse this out:
> 
>     git send-email --to [email-masked] -M --suppress-cc=all origin
> 
> and notice "--to [email-masked]" and "--suppress-cc" are for
> send-email, guess "-M" (or anything that is outside the current
> send-email's vocabulary) is meant for format-patch, and if there is no
> file or directory called "origin" then decide that the user wants to run
> format-patch, and act as a front-end as if the user did:
> 
> 	git format-patch -o tmp.$$ -M origin &&
>         ... perhaps do your --annotate and --compose here by launching
>         ... the editor...
>         git send-email --to [email-masked] --suppress-cc=all tmp.$$ &&
> 	rm -fr tmp.$$
> 
> If you happen to have a file or a directory called origin, it would be
> safer for users if the command errored out asking for disambiguation.  The
> user can either say "./origin" or "origin^0" to disambiguate between them.

Oh right you can disambiguate references using ^0 so maybe my proposal
works after all, though it has to check for each file name if it's not a
reference _also_. I like it. I will rework my patch series now then,
since most of the discussed points of them have been addressed in the
thread.

-- 
·O·  Pierre Habouzit
··O                                                [email-masked]
OOO                                                http://www.madism.org