git includeIf config wont get applied
Here is an issue that was fixed of someone who had this issue a long time ago: https://github.com/Microsoft/vscode-remote-release/issues/5312
- VS Code Version: tested with stable and insiders (as remote). It works, if I use the vscodium fork directly in WSL or on my real Linux machine.
- Local OS Version: Win11
- Remote OS Version: NixOS-WSL and alpine linux wsl
- Remote Extension/Connection Type: Dev Containers/WSL/Remote - Tunnels/VS Code Server
Steps to Reproduce:
mkdir vscodeGithooksBug
cd vscodeGithooksBug
echo "" >> ~/.gitconfig
echo "[includeIf \"gitdir:$(pwd)/\"]" >> ~/.gitconfig
echo " path = $(pwd)/.gitconfig" >> ~/.gitconfig
echo "[core]" >> .gitconfig
echo "hooksPath = $(pwd)" >> .gitconfig
echo "#!/usr/bin/env sh" >> prepare-commit-msg
echo 'echo "HookTitle - $(cat $1)" > $1' >> prepare-commit-msg
chmod +x prepare-commit-msg
git init
echo test > test.txt
git add . && git commit -m "test via git CLI"
git log
echo testVScode > test.txt
code .
Then try to commit via vscode.
I think a few VSCode versions ago, like one or two month ago it worked, but since two weeks it doesnt.
Does this issue occur when you try this locally?: No Does this issue occur when you try this locally and all extensions are disabled?: No
I would love to help you more and contribute fixes, but unfortunately this is closed-source :(
Which extension are you reporting an issue for?
@joshspicer WSL, but I havent tried the other ones.
This issue is not only about githooks, but also all other git config settings that don't get applied. For example I use different git users names, mails and signing keys for github, work and private git servers. This could lead to a deanonymization of people at high risk. E.g. a user from a dictatorship contributing code/text/documentation. @joshspicer I will fix the title.
I can confirm that this happens with devcontainers too
I tested my script above again and githooks work now. :) @iTrooz can you test again in devcontainers?
Nope, doesn't work for me, my settings still change between outside & inside the container vscode: 1.104.1 devcontainers: 0.427.0