Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [RFC/PATCH 0/2] RFC/POC: patterns for branch list

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

Michael J Gruber [off-list ref] writes:
This mini series is about introducing patterns to the list mode of
'git branch' much like the pattern for 'git tag -l'.
I do find myself often typing

    git branch | grep mg/

so this would be a welcome addition, even though the above is not too ugly
nor cumbersome.
'-l' is the natural short option name for '--list'. This is taken for the
rarely used or needed 'create reflog' option. I'd change the latter to
'-g,--create-reflog' (cmp. log) and take '-l,--list' but know the reaction
already.
My reaction would be "As the eventual goal, it is the right thing to
do---if we were writing git from scratch today, we would probably have
done so. Present a reasonable migration plan.".  Perhaps like this?

 1. Introduce "--create-reflog", and deprecate "-l".  Make "branch -l"
    emit warning and advise to use "--create-reflog" instead, but still
    act as a synonym for "--create-reflog".

    Introduce "--list" but without any short option.

    Ship 1.7.6 with these changes.

 2. Introduce "-g" as synonym for "--create-reflog".  Make "branch -l" die
    and advise to use "-g" or "--create-reflog" instead.

    Ship 1.7.X series after 1.7.7 with these changes.

 3. In 1.8.0, make "-l" a synonym for "--list".
'-v' and '-vv' both take considerable time (because they need to walk).
It makes more sense to have '-v' display cheap output (upstream name)
and '-vv' add expensive output (ahead/behind info). '-vvv' could add super
expensive info (ahead/equivalent/behind a la cherry-mark).
Probably.  Would it be a solution to deprecate "git branch -v" and make
the behaviour of "git branch -l -v{1,3}" as you described?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help