vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

git includeIf config wont get applied

Open 1muen opened this issue 9 months ago • 3 comments

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 :(

1muen avatar May 08 '25 17:05 1muen

Which extension are you reporting an issue for?

joshspicer avatar May 08 '25 22:05 joshspicer

@joshspicer WSL, but I havent tried the other ones.

1muen avatar May 09 '25 06:05 1muen

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.

1muen avatar May 28 '25 17:05 1muen

I can confirm that this happens with devcontainers too

iTrooz avatar Aug 29 '25 13:08 iTrooz

I tested my script above again and githooks work now. :) @iTrooz can you test again in devcontainers?

1muen avatar Sep 25 '25 14:09 1muen

Nope, doesn't work for me, my settings still change between outside & inside the container vscode: 1.104.1 devcontainers: 0.427.0

iTrooz avatar Sep 25 '25 21:09 iTrooz