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

[PATCH] remote: simplify "remote add --tags" help text

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 18, 2023, 22:31 UTC
Message-ID
<xmqqzg3setso.fsf@gitster.g>
In-Reply-To
<xmqq5y6gg8fn.fsf@gitster.g>

The help text for the --tags option was split into two option[] entries, which was a hacky way to give two lines of help text (the second entry did not have either short or long help, and there was no way to invoke its entry---it was there only for the help text).

As we now support multi-line text in the option help, let's make the second line of the help a proper second line and remove the hacky second entry.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/remote.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/builtin/remote.c b/builtin/remote.c
index 1e0b137d97..09fb9ae30d 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -167,10 +167,9 @@ static int add(int argc, const char **argv, const char *prefix)
 	struct option options[] = {
 		OPT_BOOL('f', "fetch", &fetch, N_("fetch the remote branches")),
 		OPT_SET_INT(0, "tags", &fetch_tags,
-			    N_("import all tags and associated objects when fetching"),
+			    N_("import all tags and associated objects when fetching\n"
+			       "or do not fetch any tag at all (--no-tags)"),
 			    TAGS_SET),
-		OPT_SET_INT(0, NULL, &fetch_tags,
-			    N_("or do not fetch any tag at all (--no-tags)"), TAGS_UNSET),
 		OPT_STRING_LIST('t', "track", &track, N_("branch"),
 				N_("branch(es) to track")),
 		OPT_STRING('m', "master", &master, N_("branch"), N_("master branch")),
-- 
2.41.0-376-gcba07a324d
Previous: Junio C HamanoNext: Junio C Hamano
Message 2 of 6 in “short help: allow multi-line opthelp”
  1. short help: allow multi-line opthelpJunio C Hamano, Jul 18, 2023
  2. remote: simplify "remote add --tags" help textJunio C Hamano, Jul 18, 2023
  3. short help: allow multi-line opthelpJunio C Hamano, Jul 18, 2023
  4. [RFC] short help: allow a gap smaller than USAGE_GAPJunio C Hamano, Jul 18, 2023
  5. Beat BolliJul 19, 2023
  6. Junio C HamanoJul 19, 2023

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.