dahlbyk / posh-git

A PowerShell environment for Git
http://dahlbyk.github.io/posh-git/
MIT License
7.62k stars 802 forks source link

git clang-format broken after installing posh-git #925

Closed bernhardmgruber closed 1 year ago

bernhardmgruber commented 1 year ago

System Details

Issue Description

git clang-format used to work before installing this extension, but fails now after installing with:

>  git clang-format
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

FYI: git clang-format invokes the python script C:\Program Files\LLVM\bin\git-clang-format, which is shipped with LLVM and in my path.

dahlbyk commented 1 year ago

Fascinating. I can't imagine how posh-git might be impacting this. Does it work again if you uninstall and/or remove Import-Module posh-git from your $PROFILE?

bernhardmgruber commented 1 year ago

Thanks for the hint! I removed the Import-Module from my profile and the problem persisted. I remember I upgraded LLVM on the same day I installed posh-git, so I have to suspect that something else broke git clang-format. I am sorry for the fuzz! It seems posh-git did nothing wrong here!

Edit: for anyone having the same problem: The problem was that C:\Program Files\LLVM\bin\git-clang-format changed shebang from #!/usr/bin/env python to #!/usr/bin/env python3. Removing the 3 makes it work again.