git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 27, 2011, 17:10 UTC
Message-ID
<7vvcxz8vtj.fsf@alter.siamese.dyndns.org>
In-Reply-To
<cover.1303906496.git.git@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> 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?

Previous: Michael J Gruber
Message 4 of 4 in “RFC/POC: patterns for branch list”
  1. 0/2 RFC/POC: patterns for branch listMichael J Gruber, Apr 27, 2011
  2. 1/2 branch: allow pattern argumentsMichael J Gruber, Apr 27, 2011
  3. 2/2 branch: introduce --list argumentMichael J Gruber, Apr 27, 2011
  4. Junio C HamanoApr 27, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.