ls-remote: introduce --branches and deprecate --heads

We call the tips of branches "heads", but this command calls the
option to show only branches "--heads", which confuses the branches
themselves and the tips of branches.

Straighten the terminology by introducing "--branches" option that
limits the output to branches, and deprecate "--heads" option used
that way.

We do not plan to remove "--heads" or "-h" yet; we may want to do so
at Git 3.0, in which case, we may need to start advertising upcoming
removal with an extra warning when they are used.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano
2024-06-04 15:01:44 -07:00
parent a096e70c78
commit b773fb8822
3 changed files with 39 additions and 12 deletions

View File

@@ -9,7 +9,7 @@ git-ls-remote - List references in a remote repository
SYNOPSIS
--------
[verse]
'git ls-remote' [--heads] [--tags] [--refs] [--upload-pack=<exec>]
'git ls-remote' [--branches] [--tags] [--refs] [--upload-pack=<exec>]
[-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]
[--symref] [<repository> [<patterns>...]]
@@ -21,14 +21,16 @@ commit IDs.
OPTIONS
-------
-h::
--heads::
-b::
--branches::
-t::
--tags::
Limit to only refs/heads and refs/tags, respectively.
Limit to only local branches and local tags, respectively.
These options are _not_ mutually exclusive; when given
both, references stored in refs/heads and refs/tags are
displayed. Note that `git ls-remote -h` used without
displayed. Note that `--heads` and `-h` are deprecated
synonyms for `--branches` and `-b` and may be removed in
the future. Also note that `git ls-remote -h` used without
anything else on the command line gives help, consistent
with other git subcommands.