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

Re: [PATCH v2 4/4] branch: make "-l" a synonym for "--list"

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 30, 2018, 18:48 UTC
Message-ID
<xmqq4lfb667c.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<87wos8cjt8.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 20 quoted lines
>> +-l::
>>  --list::
>>  	List branches.  With optional `<pattern>...`, e.g. `git
>>  	branch --list 'maint-*'`, list only the branches that match
>
> I think it's better to have something like this on top:
>
>     diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
>     index 5552dfcec3..a03cb1ebc9 100644
>     --- a/Documentation/git-branch.txt
>     +++ b/Documentation/git-branch.txt
>     @@ -163,6 +163,11 @@ This option is only applicable in non-verbose mode.
>      This should not be confused with `git branch -l <branchname>`,
>      which creates a branch named `<branchname>` with a reflog.
>      See `--create-reflog` above for details.
>     ++
>     +
>     +Until Git version 2.20 `-l` was the short form of
>     +`--create-reflog`. As of version 2.19 using it would warn about a
>     +future deprecation.

Doesn't your patch show a more grave issue with the current state of 'next'?

The sentence in the pre-context in your suggested patch says that "--list" should not be confused with "git branch -l <branchname>", but --list and -l are now synonyms in the new world order.

Worse yet, '-l' is no longer a way to create the branch with a reflog; in the new world, you would say "--create-reflog" if you want to do so. "git branch -l foo" would list branches that match that pattern 'foo'.

In the SYNOPSIS section we still see "[-l]" listed; that also must be replaced with "--create-reflog", or just dropped, as that is the default.

I do not know if the documentation that is shipped in 2.20 should talk about how the old world looked like, though. `-l` was a short for `--create-reflog` is worth saying, but I do not see much value in talking about the warning given in 2.19.

Thanks.
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 9 of 14 in “branch -l deprecation revisited”
  1. 0/4 branch -l deprecation revisitedJeff King, Jun 22, 2018
  2. 1/4 t3200: unset core.logallrefupdates when testing reflog creationJeff King, Jun 22, 2018
  3. 2/4 t: switch "branch -l" to "branch --create-reflog"Jeff King, Jun 22, 2018
  4. 3/4 branch: deprecate "-l" optionJeff King, Jun 22, 2018
  5. Eric SunshineJun 22, 2018
  6. Jeff KingJun 22, 2018
  7. 4/4 branch: make "-l" a synonym for "--list"Jeff King, Jun 22, 2018
  8. Ævar Arnfjörð BjarmasonAug 30, 2018
  9. Junio C HamanoAug 30, 2018
  10. Ævar Arnfjörð BjarmasonAug 30, 2018
  11. Jeff KingAug 30, 2018
  12. Junio C HamanoAug 30, 2018
  13. Jeff KingAug 30, 2018
  14. Ævar Arnfjörð BjarmasonAug 30, 2018

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.