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

[PATCH] rev-list: skip --grep argument in early scan

From
AMAzuama Odinaka Maximus <azuama69@gmail.com>
Date
Oct 21, 2026, 15:12 UTC
Message-ID
<20261021151253.3689-1-azuama69@gmail.com>
Signed-off-by: Azuama Odinaka Maximus <azuama69@gmail.com>
---
 builtin/rev-list.c          | 2 ++
 t/t6022-rev-list-missing.sh | 6 ++++++
 2 files changed, 8 insertions(+)
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index 0faa833fac..453d82d25c 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -771,6 +771,8 @@ int cmd_rev_list(int argc,
 			revs.exclude_promisor_objects = 1;
 		} else if (skip_prefix(arg, "--missing=", &arg)) {
 			parse_missing_action_value(repo, arg);
+		} else if (!strcmp(arg, "--grep")) {
+			i++;
 		} else if (!strcmp(arg, "--missing-only")) {
 			arg_missing_only = 1;
 		} else if (!strcmp(arg, "-z")) {
diff --git a/t/t6022-rev-list-missing.sh b/t/t6022-rev-list-missing.sh
index 1bd2c3bc4f..e87678e468 100755
--- a/t/t6022-rev-list-missing.sh
+++ b/t/t6022-rev-list-missing.sh
@@ -215,6 +215,12 @@ do
 	'
 done
 
+test_expect_success "--grep accepts a pattern beginning with --" '
+	git rev-list --grep=--missing-only --max-count=1 HEAD >expect &&
+	git rev-list --grep --missing-only --max-count=1 HEAD >actual &&
+	test_cmp expect actual
+'
+
 test_expect_success "--missing-only requires --missing=print or --missing=print-info" '
 	test_must_fail git rev-list --missing-only --objects HEAD 2>err &&
 	test_grep "requires --missing=print" err
-- 
2.53.0
Next: Pushkar Singh
Message 1 of 11 in “rev-list: skip --grep argument in early scan”
  1. rev-list: skip --grep argument in early scanAzuama Odinaka Maximus, Oct 21, 2026
  2. Pushkar SinghOct 21, 2026
  3. rev-list: skip --grep argument in early scanAzuama Odinaka Maximus, Oct 21, 2026
  4. Pushkar SinghOct 22, 2026
  5. Junio C HamanoOct 23, 2026
  6. rev-list: skip --grep argument in early scanAzuama Odinaka Maximus, Oct 26, 2026
  7. Tanga JorisNov 5, 2026
  8. rev-list: handle arguments in early option scanAzuama Odinaka Maximus, Nov 5, 2026
  9. Junio C HamanoNov 6, 2026
  10. Azuama Odinaka MaximusNov 6, 2026
  11. Junio C HamanoNov 6, 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.