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
Felipe Contreras <felipe.contreras@gmail.com>
Date
Apr 27, 2021, 19:58 UTC
Message-ID
<60886cdb7c3a2_222c20818@natae.notmuch>
In-Reply-To
<87h7ju21kg.fsf@evledraar.gmail.com>
=?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason wrote:
> On Sat, Apr 24 2021, Felipe Contreras wrote:
Show 11 quoted lines
> > 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'
> 
> Maybe I'm missing something, but if you want to find all *.jpg isn't
> that just:
> 
>     git diff '*.jpg'
> 
> ?
Right, actually I misremembered; it was all '.gitignore' files.

If I do '*.gitignore' that matches all the files, but also any $x.gitignore files. If I want only '.gitignore' files I need ':(glob)**/.gitignore'.

Cheers.
-- 
Felipe Contreras
Previous: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= BjarmasonNext: Shoaib Meenai
Message 4 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.