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

[BUG] Suspected with double asterisk in conditional include pattern

From
Jason Karns <jason.karns@gmail.com>
Date
Mar 14, 2019, 17:30 UTC
Message-ID
<CAKNmmv26G05GO7hG9bNvMsjpuUMHZRA+2f94TuG2wDNUwNhHkw@mail.gmail.com>
Hello,

I believe I've encountered a bug regarding the use of double asterisk ( /**/ ) within includeIf patterns.

git-config man pages state that
    **/ and /**, that can match multiple path components

They then refer to the gitignore man pages which further define supported wildcard patterns:

    A slash followed by two consecutive asterisks then a slash matches
zero or more directories.
    For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on.

My understanding of these docs are that the pattern `/usr/local/**/Homebrew/` ought to match both`/usr/local/cache/Homebrew/foo` and `/usr/local/Homebrew/foo`.

However, given the following conditional include rule:
    [includeIf "gitdir:/usr/local/**/Homebrew/"]

The external config file is successfully included while in repo `/usr/local/cache/Homebrew/foo` but NOT `/usr/local/Homebrew/foo`.

If I change the pattern to `**/Homebrew/**`, then the pattern matches both desired repos. So it would seem that the `/**/` does not match 0 directories when the pattern begins with a slash.

Thank you, Jason

Next: Taylor Blau
Message 1 of 9 in “[BUG] Suspected with double asterisk in conditional include pattern”
  1. Jason KarnsMar 14, 2019
  2. Taylor BlauMar 22, 2019
  3. config: correct '**' matching in includeIf patternsNguyễn Thái Ngọc Duy, Mar 23, 2019
  4. Junio C HamanoMar 24, 2019
  5. config: correct '**' matching in includeIf patternsNguyễn Thái Ngọc Duy, Mar 24, 2019
  6. Junio C HamanoMar 25, 2019
  7. Johannes SchindelinMar 25, 2019
  8. config: correct '**' matching in includeIf patternsNguyễn Thái Ngọc Duy, Mar 26, 2019
  9. Jason KarnsApr 30, 2019

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.