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

Re: [BUG] ** glob pattern in git diff doesn't match root directory

From
SMShoaib Meenai <smeenai@fb.com>
Date
Apr 26, 2021, 20:45 UTC
Message-ID
<123C2F2F-7B85-4EDD-A8D9-172CA566391D@fb.com>
In-Reply-To
<608391297345f_10cb920875@natae.notmuch>
Show 10 quoted lines
> On 4/23/21, 8:32 PM, "Felipe Contreras" <felipe.contreras@gmail.com> wrote:
> Shoaib Meenai wrote:
>> Am I misunderstanding how `**` should work, or is this a bug?
>
> I would say this is a bug, but I'm not familiar with pathspecs.
>
> I stumbled upoon a very similar issue (I wanted to find all the *.jpg in
> the repository). I couldn't find another way to do it but:
>
>   git diff ':(glob)**/foo'

Ah, "pathspec" is the piece of vocabulary that I was missing. Looking at the git documentation for pathspecs, I can see how this is supposed to behave, and `:(glob)` is exactly the behavior I'm looking for. Thank you!

Show 5 quoted lines
>
> Cheers.
>
> --
> Felipe Contreras
Previous: Felipe ContrerasNext: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason
Message 5 of 7 in “[BUG] ** glob pattern in git diff doesn't match root directory”
  1. Shoaib MeenaiApr 24, 2021
  2. Felipe ContrerasApr 24, 2021
  3. =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= BjarmasonApr 26, 2021
  4. Felipe ContrerasApr 27, 2021
  5. Shoaib MeenaiApr 26, 2021
  6. =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= BjarmasonApr 26, 2021
  7. Shoaib MeenaiApr 26, 2021

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.