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

Re: [PATCH] reflog: fix expire --single-worktree

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 29, 2023, 22:31 UTC
Message-ID
<xmqqa5s1hxhh.fsf@gitster.g>
In-Reply-To
<63eade0e-bf2c-4906-8b4c-689797cff737@web.de>
René Scharfe <l.s.r@web.de> writes:
> ... and added a non-printable short flag for it, presumably by
> accident.
Very well spotted.

FWIW, with the following patch on top of this patch, all tests pass (and without your fix, of course this notices the "\001" and breaks numerous tests that use "git reflog"). So you seem to have found the only one broken instance (among those that are tested, anyway).

 parse-options.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git i/parse-options.c w/parse-options.c
index 093eaf2db8..be8bedba29 100644
--- i/parse-options.c
+++ w/parse-options.c
@@ -469,7 +469,8 @@ static void parse_options_check(const struct option *opts)
 			optbug(opts, "uses incompatible flags "
 			       "LASTARG_DEFAULT and OPTARG");
 		if (opts->short_name) {
-			if (0x7F <= opts->short_name)
+			if (opts->short_name &&
+			    (opts->short_name < 0x21 || 0x7F <= opts->short_name))
 				optbug(opts, "invalid short name");
 			else if (short_opts[opts->short_name]++)
 				optbug(opts, "short name already used");
Previous: René ScharfeNext: René Scharfe
Message 2 of 7 in “reflog: fix expire --single-worktree”
  1. reflog: fix expire --single-worktreeRené Scharfe, Oct 28, 2023
  2. Junio C HamanoOct 29, 2023
  3. René ScharfeOct 30, 2023
  4. Junio C HamanoOct 30, 2023
  5. René ScharfeOct 31, 2023
  6. Taylor BlauOct 30, 2023
  7. Junio C HamanoOct 30, 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.