Fix environment-dependent git pre-commit hooks
This is a follow up to #9948 and [vscode#90178](https://github.com/microsoft/vscode/issues/90178). After looking at the problem of environment-dependent pre-commit hooks from both the extension's and the editor's side, it seems to me the best solution would be for the Python extension to make sure that whatever environment the user has selected in the status bar is also active during the commit process (using VS Code's source control panel). I think this would be the expected behavior by most users if you asked them. At least it took me by surprise that my active environment doesn't apply during the commit process even though it's indicated in the status bar. Hence why it took me a while to figure out this is the reason my pre-commit hooks aren't working. One way to activate the status bar environment in the spawned git process might be [as @joaomoreno mentioned](https://github.com/microsoft/vscode/issues/90178#issuecomment-587340311) to have a `git` wrapper that's local to the source control panel (i.e. doesn't affect `git` anywhere else) and simply activates the environment before handing over to real `git`.
Posted by janosh on Feb 18, 2020, 8:52 AM
Tags
Related issues
- [Meta] Feedback on granular control over Copilot changes
- unexpected status 401 Unauthorized issue
- [MODEL] Measurable quality regression in Claude generation 5 (Fable 5 / Opus 5 / Sonnet 5): worse nonsense detection, ~2x verbosity, under-disclosed model fallb
- [CRITICAL] Subagent spawning and subagent pattern bugs trigger infinite recursion, infinite token usage, grossly inefficient token usage, and lost accumulated s
- Video stops playing after some minutes
- [MODEL] Claude verbose code comments by default — ignores instructions to stop.
Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments
github (Software)
[Meta] Feedback on granular control over Copilot changes
unexpected status 401 Unauthorized issue
[MODEL] Measurable quality regression in Claude generation 5 (Fable 5 / Opus 5 / Sonnet 5): worse nonsense detection, ~2x verbosity, under-disclosed model fallb
[CRITICAL] Subagent spawning and subagent pattern bugs trigger infinite recursion, infinite token usage, grossly inefficient token usage, and lost accumulated s
Video stops playing after some minutes
[MODEL] Claude verbose code comments by default — ignores instructions to stop.
Scope Codex VS Code chats to the current workspace/project
Update on "Co-authored-by: Copilot" in commit messages
Fix environment-dependent git pre-commit hooks
This is a follow up to #9948 and [vscode#90178](https://github.com/microsoft/vscode/issues/90178). After looking at the problem of environment-dependent pre-commit hooks from both the extension's and the editor's side, it seems to me the best solution would be for the Python extension to make sure that whatever environment the user has selected in the status bar is also active during the commit process (using VS Code's source control panel). I think this would be the expected behavior by most users if you asked them. At least it took me by surprise that my active environment doesn't apply during the commit process even though it's indicated in the status bar. Hence why it took me a while to figure out this is the reason my pre-commit hooks aren't working. One way to activate the status bar environment in the spawned git process might be [as @joaomoreno mentioned](https://github.com/microsoft/vscode/issues/90178#issuecomment-587340311) to have a `git` wrapper that's local to the source control panel (i.e. doesn't affect `git` anywhere else) and simply activates the environment before handing over to real `git`.
Comments (0)
No comments yet. Start the discussion.