Re: [PATCH 2/2] branch --merged/--not-merged: allow specifying arbitrary commit
On Wed, Jul 09, 2008 at 01:22:10AM +0000, Junio C Hamano wrote:
Show 20 quoted lines
> "git-branch --merged" is a handy way to list all the branches that have
> already been merged to the current branch, but it did not allow checking
> against anything but the current branch. Having to check out only for
> that purpose made the command practically useless.
>
> This updates the option parser so that "git branch --merged next" is
> accepted when you are on 'master' branch.
>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>
> * This does have an issue. --no-<option>=<value> is often nonsense and
> parse-options does not accept it (and I do not think we would want to
> change it). The use of "--no-merged" was a mistake, but nobody has
> perfect foresight.
>
> This adds --not-merged <commit> and allows the <commit> to default to
> HEAD if not given to work it around. This and the previous one are not
> for application but primarily meant for discussion on what further
> flexibility we may want to have in parse-options.
There's a way: declare --merge as (PARSE_OPT_)NONEG to tell parse-opt
not to generate --no-merge by itself, and declare a --no-merge option as
well. I think it works, and if not, we should make parse-opt work with
that. This is a quite disgusting hack, and no *new* options should be
written this way, but we have to be flexible enough for backward
compatibility's sake.
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org