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

[PATCH 1/1] ls-remote: don't use '-h' for options

From
Ddev@pascalroeleven.nl <dev@pascalroeleven.nl>
Date
Feb 27, 2020, 11:42 UTC
Message-ID
<b0397b3285eab3448a3fd5dd2c50abb9@pascalroeleven.nl>

The '-h' option for ls-remote will never be reached as the argument is already processed by the git wrapper before passed on to ls-remote. The ls-remote help text will therefore be displayed instead of the '--heads' option.

Signed-off-by: Pascal Roeleven <dev@pascalroeleven.nl>
---
  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 a2ea1fd..b5b7d7a 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 6ef5195..85ce336 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.20.1
Next: Danh Doan
Message 1 of 6 in “ls-remote: don't use '-h' for options”
  1. 1/1 ls-remote: don't use '-h' for optionsdev@pascalroeleven.nl, Feb 27, 2020
  2. Danh DoanFeb 27, 2020
  3. Pascal RoelevenFeb 27, 2020
  4. Junio C HamanoFeb 27, 2020
  5. Pascal RoelevenFeb 27, 2020
  6. Junio C HamanoFeb 27, 2020

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.