git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Ignacy Gawedzki" <ignacy.gawedzki@green-communications.fr>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 2/3] ls-remote: remove documentation for custom -h option
Date: Fri, 24 Sep 2021 18:51:45 +0200	[thread overview]
Message-ID: <patch-2.3-32b8dbecfe0-20210924T164820Z-avarab@gmail.com> (raw)
In-Reply-To: <cover-0.3-00000000000-20210924T164820Z-avarab@gmail.com>

The custom handling of the "-h" option was broken in
ba5f28bf79e (ls-remote: use parse-options api, 2016-01-19), first
released with Git v2.8.0. We've been promising that it's a synonym of
--head, but it's not.

We could make this work again by supplying the
PARSE_OPT_NO_INTERNAL_HELP flag to parse_options(), but if we were
writing this command today we wouldn't make this an exception. Since
it's been such a long time let's just remove this rather than
restoring the exception to "-h" handling.

Reported-by: Ignacy Gawedzki <ignacy.gawedzki@green-communications.fr>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 Documentation/git-ls-remote.txt | 1 -
 builtin/ls-remote.c             | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/Documentation/git-ls-remote.txt b/Documentation/git-ls-remote.txt
index 492e573856f..6e241640bd9 100644
--- a/Documentation/git-ls-remote.txt
+++ b/Documentation/git-ls-remote.txt
@@ -21,7 +21,6 @@ commit IDs.
 
 OPTIONS
 -------
--h::
 --heads::
 -t::
 --tags::
diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c
index f4fd823af83..c5e68918b78 100644
--- a/builtin/ls-remote.c
+++ b/builtin/ls-remote.c
@@ -64,7 +64,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
 			   N_("path of git-upload-pack on the remote host"),
 			   PARSE_OPT_HIDDEN },
 		OPT_BIT('t', "tags", &flags, N_("limit to tags"), REF_TAGS),
-		OPT_BIT('h', "heads", &flags, N_("limit to heads"), REF_HEADS),
+		OPT_BIT(0, "heads", &flags, N_("limit to heads"), REF_HEADS),
 		OPT_BIT(0, "refs", &flags, N_("do not show peeled tags"), REF_NORMAL),
 		OPT_BOOL(0, "get-url", &get_url,
 			 N_("take url.<base>.insteadOf into account")),
-- 
2.33.0.1285.g7aff81f6560


  parent reply	other threads:[~2021-09-24 16:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-24 14:19 Wrong option -h in grep, ls-remote, and show-ref Ignacy Gawedzki
2021-09-24 16:51 ` [PATCH 0/3] show-ref, ls-remote, grep: fix -h handling Ævar Arnfjörð Bjarmason
2021-09-24 16:51   ` [PATCH 1/3] show-ref: remove unused custom handling of -h Ævar Arnfjörð Bjarmason
2021-09-24 19:24     ` Junio C Hamano
2021-09-24 20:53       ` René Scharfe
2021-09-24 21:21         ` Junio C Hamano
2021-09-24 16:51   ` Ævar Arnfjörð Bjarmason [this message]
2021-09-24 17:11     ` [PATCH 2/3] ls-remote: remove documentation for custom -h option SZEDER Gábor
2021-09-24 17:54       ` Jeff King
2021-09-24 18:17       ` Junio C Hamano
2021-09-24 16:51   ` [PATCH 3/3] grep: pass PARSE_OPT_NO_INTERNAL_HELP, fix odd -h handling Ævar Arnfjörð Bjarmason
2021-09-24 18:12 ` Wrong option -h in grep, ls-remote, and show-ref Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=patch-2.3-32b8dbecfe0-20210924T164820Z-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ignacy.gawedzki@green-communications.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).