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

[PATCH 1/3] show-ref: remove unused custom handling of -h

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Sep 24, 2021, 16:51 UTC
Message-ID
<patch-1.3-c79a3907a27-20210924T164820Z-avarab@gmail.com>
In-Reply-To
<cover-0.3-00000000000-20210924T164820Z-avarab@gmail.com>

Since b92891f9783 (parseopt: add PARSE_OPT_NO_INTERNAL_HELP, 2009-03-08) parse_options() has handled "-h" unless told not to, so when show-ref was migrated to parse_options() in 69932bc6117 (show-ref: migrate to parse-options, 2009-06-20) the custom "-h" handling that was retained did nothing.

The option was then hidden in e62b3935056 (Show usage string for 'git show-ref -h', 2009-11-09), but that OPT_BOOLEAN didn't do anything. Let's just remove this dead code.

Reported-by: Ignacy Gawedzki <ignacy.gawedzki@green-communications.fr>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/show-ref.c | 2 --
 1 file changed, 2 deletions(-)
diff --git a/builtin/show-ref.c b/builtin/show-ref.c
index 7f8a5332f83..8cefb663282 100644
--- a/builtin/show-ref.c
+++ b/builtin/show-ref.c
@@ -163,8 +163,6 @@ static const struct option show_ref_options[] = {
 	OPT_BOOL(0, "heads", &heads_only, N_("only show heads (can be combined with tags)")),
 	OPT_BOOL(0, "verify", &verify, N_("stricter reference checking, "
 		    "requires exact ref path")),
-	OPT_HIDDEN_BOOL('h', NULL, &show_head,
-			N_("show the HEAD reference, even if it would be filtered out")),
 	OPT_BOOL(0, "head", &show_head,
 	  N_("show the HEAD reference, even if it would be filtered out")),
 	OPT_BOOL('d', "dereference", &deref_tags,
-- 
2.33.0.1285.g7aff81f6560
Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 3 of 12 in “Wrong option -h in grep, ls-remote, and show-ref.”
  1. Ignacy GawedzkiSep 24, 2021
  2. 0/3 show-ref, ls-remote, grep: fix -h handlingÆvar Arnfjörð Bjarmason, Sep 24, 2021
  3. 1/3 show-ref: remove unused custom handling of -hÆvar Arnfjörð Bjarmason, Sep 24, 2021
  4. Junio C HamanoSep 24, 2021
  5. René ScharfeSep 24, 2021
  6. Junio C HamanoSep 24, 2021
  7. 2/3 ls-remote: remove documentation for custom -h optionÆvar Arnfjörð Bjarmason, Sep 24, 2021
  8. SZEDER GáborSep 24, 2021
  9. Jeff KingSep 24, 2021
  10. Junio C HamanoSep 24, 2021
  11. 3/3 grep: pass PARSE_OPT_NO_INTERNAL_HELP, fix odd -h handlingÆvar Arnfjörð Bjarmason, Sep 24, 2021
  12. Junio C HamanoSep 24, 2021

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.