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

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

From
TJTanga Joris <tangajoris@gmail.com>
Date
Nov 5, 2026, 07:53 UTC
Message-ID
<CAKrRMNrnd2+HxTxadKaha+K9ASWi_oN4h7gdjVYAGmyODwmi=w@mail.gmail.com>
In-Reply-To
<20261026083055.18873-1-azuama69@gmail.com>
Hello Azuama,
Thanks for working on this.

I applied v3 on top of master (0ffa3e35c7) with "git am -3", because builtin/rev-list.c has changed since you sent it, so running "git am" fails. Rebasing on master would help. I built it with NO_RUST=1. t6022 passes, and both new tests fail when I revert only the change in builtin/rev-list.c, so they do catch the problem.

On Mon, 26 Oct 2026 at 11:30, Azuama Odinaka Maximus <azuama69@gmail.com> wrote:
> +test_expect_success "--grep accepts a pattern beginning with --" '
> +        test_commit --no-tag --missing-only &&
> +        commit=$(git rev-parse HEAD) &&

These lines are indented with spaces instead of a tab. "git diff --check" reports "indent with spaces" for all the new test lines.

> +             } else if (!strcmp(arg, "--grep")) {
> +                     i++;

This fixes --grep, but other options that take a separate value still have the same problem. In a repository whose only commit has "--missing-only" as both its subject and its author name, with this patch:

  $ git rev-list --grep --missing-only HEAD
  <the commit>
  $ git rev-list --author --missing-only HEAD
  fatal: --missing-only requires --missing=print or --missing=print-info

--committer and --grep-reflog fail the same way. In revision.c, 19 options are parsed with parse_long_opt(), which accepts the value as a separate argument (--author, --committer, --since, --until, --skip, --exclude and others). Should the early scan skip the value of all of them, or is there a reason to handle only --grep? If this only fixes --grep for now, the commit message could say so, because its first paragraph describes the general problem.

Also, the NEEDSWORK comment just above this loop uses "--grep --exclude-promisor-objects" as its example of what the loop gets wrong. With this patch that example works, so the comment needs a new example (--author would do), or it simply becomes misleading.

Thanks, Tanga

Previous: Azuama Odinaka MaximusNext: Azuama Odinaka Maximus
Message 7 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.