git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [BUG] Suspected with double asterisk in conditional include pattern
@ 2019-03-14 17:30 Jason Karns
  2019-03-22 19:04 ` Taylor Blau
  2019-03-23  3:45 ` [PATCH] config: correct '**' matching in includeIf patterns Nguyễn Thái Ngọc Duy
  0 siblings, 2 replies; 9+ messages in thread
From: Jason Karns @ 2019-03-14 17:30 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-04-30 22:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-14 17:30 [BUG] Suspected with double asterisk in conditional include pattern Jason Karns
2019-03-22 19:04 ` Taylor Blau
2019-03-23  3:45 ` [PATCH] config: correct '**' matching in includeIf patterns Nguyễn Thái Ngọc Duy
2019-03-24 12:56   ` Junio C Hamano
2019-03-24 13:17   ` [PATCH v2] " Nguyễn Thái Ngọc Duy
2019-03-25  2:30     ` Junio C Hamano
2019-03-25 21:40     ` Johannes Schindelin
2019-03-26  9:41     ` [PATCH v3] " Nguyễn Thái Ngọc Duy
2019-04-30 22:07       ` Jason Karns

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).