Skip to content

Make existing hook-failure diagnostics independent of shell-environment loading - #23011

Closed
molnarriso wants to merge 1 commit into
desktop:developmentfrom
molnarriso:fix/hook-diagnostics-without-shell-env
Closed

molnarriso wants to merge 1 commit into
desktop:developmentfrom
molnarriso:fix/hook-diagnostics-without-shell-env

Conversation

@molnarriso

@molnarriso molnarriso commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Closes #23012

Description

GitHub Desktop already has hook-specific failure reporting, but it is currently gated by “Load Git hook environment variables from shell.” Disabling that preference bypasses the entire hook proxy, including the existing failure callbacks and UI.

This PR makes that existing reporting available independently of shell loading. The preference controls where the hook’s environment comes from, rather than whether Desktop identifies a failing hook. No additional reporting mechanism or UI is introduced.

  • Reuse the existing hook proxy and diagnostics in both modes.
  • Preserve shell-environment loading when enabled.
  • When disabled, inherit the Git child environment, preserving configuration and credentials while removing Desktop’s temporary interception settings.
  • Skip pre-push interception for pushes using --no-verify.
  • Add regression tests for inherited-environment preservation.

This improves error attribution; it does not change interpreter selection or fix underlying Bash/WSL failures.

Validation on Windows:

  • Unit suite: 2,247 passed, 3 skipped.
  • Script tests: 29 passed.
  • ESLint-rule tests: 6 passed.
  • TypeScript, lint, formatting, whitespace checks, and production-mode unpackaged build passed.
  • GUI smoke test passed. Nine updater tests were skipped because they require an installed Squirrel application.
  • Focused real-Git checks passed for hook failure, abort/ignore handling, arguments, stdin, and inherited configuration.

Screenshots

No UI components changed. This enables the existing hook-failure dialog when shell-environment loading is disabled.

Release notes

Notes: Git hook failures are now identified even when loading environment variables from the shell is disabled.

@molnarriso
molnarriso requested a review from a team as a code owner October 13, 2026 20:10
@molnarriso
molnarriso requested a review from BagToad October 13, 2026 20:10
@github-actions github-actions Bot added external Pull request originating outside of the Desktop core team needs-triage unmet-requirements and removed needs-triage labels Oct 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your pull request! Unfortunately, it doesn't meet the requirements for review:

  • No linked help wanted issue found in PR description

Please update your PR to address the above. This PR will be automatically closed in 7 days if these requirements are not met.

Full contribution requirements
  1. Include a detailed description of what this PR does
  2. Link to an issue with the help wanted label (use Fixes #123 or Closes #123)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external Pull request originating outside of the Desktop core team unmet-requirements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Existing hook-failure diagnostics are unnecessarily gated by shell-environment loading

1 participant