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

[PATCH] ls-remote: Remove conflicting option "-h"

From
MHMattias Hansson <mattias.hansson@axis.com>
Date
Oct 30, 2019, 17:33 UTC
Message-ID
<20191030173337.6574-1-mattias.hansson@axis.com>
From: Mattias Hansson <hansson.mattias@gmail.com>

The "-h" option is documented to limit the result to heads, which is a bit nonintuitive since "-h" is commonly used as the short option for "--help". However, "-h" currently displays the usage information which proves that there's a double reference to the option.

This patch will remove "-h" as a short option for "--heads". This will maintain the current behaviour and correct the misleading documentation.

Signed-off-by: Mattias Hansson <hansson.mattias@gmail.com>
---
 builtin/ls-remote.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c
index 6ef519514b..85ce336fc3 100644
--- a/builtin/ls-remote.c
+++ b/builtin/ls-remote.c
@@ -63,7 +63,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.22.0
Next: SZEDER Gábor
Message 1 of 2 in “ls-remote: Remove conflicting option "-h"”
  1. ls-remote: Remove conflicting option "-h"Mattias Hansson, Oct 30, 2019
  2. SZEDER GáborOct 30, 2019

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.