-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Configuration file: Incorrect matching of conditional includes #5068
New issue
Have a question about this project? Sign up for a free GitHub accoun 8000 t to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yeah, our "gitdir:" includes have a heavy mismatch in semantics compared to git.git. I accidentally stumbled upon this issue yesterday when taking a look at why our gitignore parser behaves differently: turns out git.git has migrated to use wildmatch instead of fnmatch in 2014, which caused quite a lot of incompatibilities. So I've migrated our code to use wildmatch, too, in #5110. This PR fixes several issues in our config parser as well as in our conditional include handling. I'm a bit confused, though. The first includeIf was obviously a fault on our side, and that issue got fixed via #5110. But the second condition "D:/repository?.git" shouldn't match at all, but from your
Which version of git were you using? |
Using git version 2.17.1.windows.2 |
I can reproduce this behaviour with v2.17.1.windows.2, but in fact it's fixed in v2.22.0.windows.1: none of the conditional includes get included. So with #5110 being merged, libgit2 now behaves the same as Git for Windows v2.22.0. Closing -- please feel free to reopen if you feel like your issue hasn't been fixed after all. |
Reproduction steps
libgit2
usesFNM_PATHNAME|FNM_LEADING_DIR
fnmatch
flags to match the conditional include pattern, but it seems that git does not do so.?
,*
and[]
in the pattern to/
in the path, while git does.Consider repository with git directory
D:\repository\.git
withconfig
file that containsand configuration files
D:\repository\.git\cfg1
andD:\repository\.git\cfg2
with content:and
respectively.
git does not include
cfg
file:Version of libgit2 (release number or SHA1)
a904fc6
Operating system(s) tested
Windows
The text was updated successfully, but these errors were encountered: