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

[PATCH] history: fix short help for argument of --update-refs

From
René Scharfe <l.s.r@web.de>
Date
Apr 6, 2026, 09:31 UTC
Message-ID
<ff6a940c-39fc-4dbf-a164-7770c7f26a31@web.de>

"print" is not a valid argument for --update-refs. List both valid alternatives literally in the argh string, consistent with documentation and usage string.

Signed-off-by: René Scharfe <l.s.r@web.de>
---
git history is a new command in the coming release.
 builtin/history.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/builtin/history.c b/builtin/history.c
index 568dc75ee7..9526938085 100644
--- a/builtin/history.c
+++ b/builtin/history.c
@@ -437,8 +437,8 @@ static int cmd_history_reword(int argc,
 	enum ref_action action = REF_ACTION_DEFAULT;
 	int dry_run = 0;
 	struct option options[] = {
-		OPT_CALLBACK_F(0, "update-refs", &action, N_("<action>"),
-			       N_("control which refs should be updated (branches|head)"),
+		OPT_CALLBACK_F(0, "update-refs", &action, "(branches|head)",
+			       N_("control which refs should be updated"),
 			       PARSE_OPT_NONEG, parse_ref_action),
 		OPT_BOOL('n', "dry-run", &dry_run,
 			 N_("perform a dry-run without updating any refs")),
@@ -666,8 +666,8 @@ static int cmd_history_split(int argc,
 	enum ref_action action = REF_ACTION_DEFAULT;
 	int dry_run = 0;
 	struct option options[] = {
-		OPT_CALLBACK_F(0, "update-refs", &action, N_("<refs>"),
-			       N_("control ref update behavior (branches|head|print)"),
+		OPT_CALLBACK_F(0, "update-refs", &action, "(branches|head)",
+			       N_("control ref update behavior"),
 			       PARSE_OPT_NONEG, parse_ref_action),
 		OPT_BOOL('n', "dry-run", &dry_run,
 			 N_("perform a dry-run without updating any refs")),
-- 
2.53.0
Next: Patrick Steinhardt
Message 1 of 2 in “history: fix short help for argument of --update-refs”
  1. history: fix short help for argument of --update-refsRené Scharfe, Apr 6, 2026
  2. Patrick SteinhardtApr 7, 2026

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.