-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Git integration does not correctly support includeIf
directive
#40354
New issue
Have a question about this project? Sign up for a free GitHub account 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
It sure seems to be so... This is what git returns:
|
What does |
|
includeIf
directive
This issue also effects me and I am using includeif in my global gitconfig.
|
@joaomoreno any update on this issue? This is still friction for using the git integration in vscode. |
@motowilliams I can't seem to reproduce this on macOS: I removed the
is this a Windows specific issue? I'll try testing on Windows and Linux. Edit: I can reproduce the issue on Windows 10 (1803) and Git for Windows 2.17. I have not tested on Linux. This may be a Windows specific issue. |
@motowilliams I figured out the issue and have devised a workaround: VS Code passes a lowercase drive letter when launching Git, which somehow breaks the includeIf checking logic. Thus, just use
which enables case insensitive compare. This fixes the issue; I was able to commit successfully (Windows 10 1803, Git for Windows 2.17, Version 1.24.0-insider Commit a521c01 Date 2018-05-21T05:18:01.058Z) I'm not sure whether the lowercase drive letter is coming from. I'll have to see how Git is launched on Windows. How I found this: I wrapped Git with a Batch file to see what was passed into Git:
And set git.path in VSCode to use this executable. I tried to commit from VSCode, which failed to pick up the includeIf config. Then I ran the wrapper from the command line, and it did pick up the includeIf. I then checked the log: In VSCode:
Outside:
Note the difference in the case letter. |
…40354) Git's includeIf feature by default matches the path against the current working directory in a case sensitive manner. VS Code launches Git using a current working directory with a lowercase drive letter, while everything else uses an uppercase drive letter, so includeIf directives that work everywhere else don't work in VS Code. This commit borrows the fix from microsoft#9448, which manually uppercases the drive letter for Windows.
That means there's an actual workaround until releasing a new version of VSCode. Use |
Can confirm the workaround of using case-insensitive gitdir ( |
Guys, I can't even get this working on my Windows machine, independent of VS Code. Here's my setup:
When running What am I doing wrong? |
@joaomoreno You need a trailing slash in the path. Try:
|
Thanks @zhuowei, that was it. I really do think Closing this. |
Uh oh!
There was an error while loading. Please reload this page.
Steps to Reproduce:
Reproduces without extensions: Yes
This is NOT a Please tell me who you are issue as indicated by #36368. This feature works as expected with the git cli and well as Visual Studio Team Explorer where it was fixed in issue Team Explorer does not recognize git includeIf directive
The text was updated successfully, but these errors were encountered: