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
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Aug 30, 2018, 08:58 UTC
Message-ID
<87wos8cjt8.fsf@evledraar.gmail.com>
In-Reply-To
<20180622092459.GD13573@sigill.intra.peff.net>
On Fri, Jun 22 2018, Jeff King wrote:
Show 21 quoted lines
> diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
> index 1072ca0eb6..fc88e984e1 100644
> --- a/Documentation/git-branch.txt
> +++ b/Documentation/git-branch.txt
> @@ -100,8 +100,6 @@ OPTIONS
>  	The negated form `--no-create-reflog` only overrides an earlier
>  	`--create-reflog`, but currently does not negate the setting of
>  	`core.logAllRefUpdates`.
> -+
> -The `-l` option is a deprecated synonym for `--create-reflog`.
>
>  -f::
>  --force::
> @@ -156,6 +154,7 @@ This option is only applicable in non-verbose mode.
>  --all::
>  	List both remote-tracking branches and local branches.
>
> +-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.
     -v::
     -vv::

We're about to release 2.19 with the deprecation (but it still means --create-reflog), this patch is sitting in next.

Similarly to your 2/4 we'll have some scripts in the wild using -l, let's at least give them a headsup that this changed in the docs, as well as anyone on >=2.20 (or whenever we plan to merge this down from next) a warning that if they're writing some script they can't rely on `-l` for older clients.

Previous: Jeff KingNext: Junio C Hamano
Message 8 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.