Repository navigation
Description
Setup
- Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options
git version 2.25.0.windows.1
cpu: x86_64
built from commit: 7c71c859c97853ed057da5cbab12f3c13b5554df
sizeof-long: 4
sizeof-size_t: 8
- Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver
Microsoft Windows [Version 10.0.17763.973]
- What options did you set as part of the installation? Or did you choose the
defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt
Editor Option: VisualStudioCode
Custom Editor Path:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Disabled
Enable Symlinks: Disabled
- Any other interesting things about your environment that might be related
to the issue you're seeing?
Don't think so
Details
- Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other
cmd / powershell / gitbash
- What commands did you run to trigger this issue? If you can provide a
Minimal, Complete, and Verifiable example
this will help us understand the issue.
git config --list --show-origin
- What did you expect to occur after running these commands?
the additional git config file would be included as per the includeIf rule
- What actually happened instead?
additional git config file is not included
- If the problem was occurring with a specific repository, can you provide the
URL to that repository to help us with testing?
all repos
- Further details
I can fix the issue by going to an earlier version and I've tried a few:
- 2.24.1.2
- 2.23.0
- 2.20.1
- 2.15.1.2
As soon as I upgrade to 2.25.0, the includeIf stops working. Then I roll back to an earlier version of git and it starts working again. I can switch between working and not working by reinstalling the different versions. I'm currently back on 2.24.1.2 and everything is working fine.
Activity
dscho commentedon Feb 6, 2020
That sounds interesting, if a little vague. Can you construct a config that displays the issue?
dscho commentedon Feb 6, 2020
(By that, I mean a config that I can drop into a freshly
git inited worktree to try to repro on my side?)Russ-K commentedon Feb 7, 2020
ok, sorry, there is a bit more to this...
And it looks like it's only broken for mapped drives.
C: is a normal drive
W: is a mapped drive (actually maps to c:\work)
I have the following folder / file structure:
C:\Users\Redacted\.gitconfig looks like this:
C:\personal\.gitconfig looks like this:
W:\corp1\.gitconfig looks like this:
Using the following command in each folder:
git config --list --show-origin2.25.0.windows.1
This is what I get on 2.25.0.windows.1 in C:\personal\repoa (this is working fine)
This is what I get on 2.25.0.windows.1 in W:\corp1\repob (this is broken)
2.24.1.windows.2
And if I revert to 2.24.1.windows.2 and change nothing else then in C:\personal\repoa (this is working fine)
and in W:\corp1\repob (this is working fine)
The difference being that running the command in W:\corp1\repob on 2.24.1.windows.2 these additional 2 lines are shown
Hope that helps narrow it down.
Let me know if you need any further details.
dscho commentedon Feb 9, 2020
Oooh, this is interesting, as I fixed another bug for mapped drives recently. Could you test with the latest snapshot? You can use the Portable Git if you don't want to mess with your current installed Git.
Russ-K commentedon Feb 10, 2020
Using version:
2.25.0.windows.1.17.g89a5bbfd1eThe issue still exists.
dscho commentedon Feb 10, 2020
Thanks for testing!
Russ-K commentedon Feb 10, 2020
No worries, let me know if you need me to test more.
dscho commentedon Feb 10, 2020
I thought so.
Okay, that is a good find!
So an MCVE would start by
subst W: C:\workor something.The problem is that we actually fixed a bug here: symlinked git dirs are now resolved properly. And that fix implies that the gitdir for
W:\...is now resolved toC:\work\..., too.dscho commentedon Feb 10, 2020
@Russ-K to understand what I mean, please run
git rev-parse --git-dirinW:\...both with v2.25.0 and with any previous Git for Windows version. You will see that v2.25.0 successfully figures out the actual Git directory while previous versions did not...Now, arguably we could try to let Git be smart and to resolve the path provided via
includeIf. That is an option, but it is not totally trivial, as the argument is actually allowed to contain wildcards. And if you have NTFS junctions, that means that you simply cannot resolve something likeW:/abc/**/hello, as there might be an NTFS junction underW:/abc/that makes things resolve to a totally different location.dscho commentedon Feb 10, 2020
@Russ-K so if you want to go along those lines (with the caveat that it cannot be complete for wildcards), you could do something like this:
To play with this,
sdk cd git,make -j$(nproc)./git --exec-path="$PWD" -C <directory> <command>?dscho commentedon Feb 10, 2020
@Russ-K so if you want to go along those lines (with the caveat that it cannot be complete for wildcards), you could do something like this:
To play with this,
sdk cd git,make -j$(nproc)./git --exec-path="$PWD" -C <directory> <command>?dscho commentedon Mar 7, 2020
Well, this is disappointing. No effort whatsoever? I should not have bothered.
Russ-K commentedon Mar 9, 2020
Apologies, I have a day job and I spent a lot of time identifying the exact scenario for the issue.
I will try to look at this soon as I still require it but as you've identified a workaround, it is of less importance.