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

Re: Possible regression in `git grep --untracked` pathspec matching in v2.27.0

From
Elijah Newren <newren@gmail.com>
Date
Jun 3, 2020, 14:14 UTC
Message-ID
<CABPp-BEPOn_JL1FDA-z1jfkfej4dEbbODkcmzNWwY7V-=WsMVw@mail.gmail.com>
In-Reply-To
<CAJmdR_pG74x0Zn43MSm7zXNcoitqjjOy+WnhyGBW+oFjVFLbRQ@mail.gmail.com>
Hi,
On Tue, Jun 2, 2020 at 8:30 PM John Millikin <jmillikin@stripe.com> wrote:
Show 26 quoted lines
>
> In v2.26.2 and earlier, `git grep --untracked` with negative pathspec patterns
> would filter out paths matching those patterns. In v2.27.0, this no longer works
> as expected.
>
> Example output:
>
> # v2.26.2 (good)
> $ ./git grep --untracked --files-with-matches -e '.' -- 'quote.*' ':!quote.c'
> quote.h
> $
>
> # v2.27.0 (bad)
> $ ./git grep --untracked --files-with-matches -e '.' -- 'quote.*' ':!quote.c'
> quote.c
> quote.h
> $
>
> I've bisected the change to commit 95c11ecc73f286e0a95d9591ae98f1221efe4633,
> which changed the handling of path matches in callers of `fill_directory()`.
>
> It's not clear from git-grep(1) whether the old or new behavior is "correct",
> so I request that the fix include a clarification of expected semantics.
>
> Thanks,
> - John Millikin

Oh, fun, an issue from _that_ series. At least the commit you bisected to wasn't 8d92fb292706 (dir: replace exponential algorithm with a linear one, 2020-04-01), though.

Thanks for the detailed report. I'll try to get some time to take a look later this week.

Elijah
Previous: John MillikinNext: Elijah Newren
Message 2 of 3 in “Possible regression in `git grep --untracked` pathspec matching in v2.27.0”
  1. John MillikinJun 3, 2020
  2. Elijah NewrenJun 3, 2020
  3. Elijah NewrenJun 5, 2020

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.