[PR #6346] [CLOSED] fix(hooks): add a sh shebang so husky hooks run from Git Bash on Windows #7294

Closed
opened 2026-11-01 21:46:49 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/6346
Author: @agnaylor
Created: 10/22/2026
Status: ❌ Closed

Base: main ← Head: pr/husky-shebang


📝 Commits (1)

  • 06aa039 fix(hooks): add a sh shebang so husky hooks run from Git Bash on Windows

📊 Changes

2 files changed (+2 additions, -0 deletions)

View changed files

📝 .husky/pre-commit (+1 -0)
📝 .husky/pre-push (+1 -0)

📄 Description

Summary

git commit and git push from Git Bash on Windows failed with cannot spawn .husky/pre-commit: Exec format error because the husky hook files have no interpreter line. Adding #!/usr/bin/env sh to both hooks lets Git run them on Windows; Linux and macOS are unaffected (husky invokes them through sh there either way).

Problem and expected behavior

Trigger: any commit in a source checkout on Windows with Git for Windows. Expected: the lint-staged pre-commit task runs as it does on Linux.

Change and scope

Two one-line additions, .husky/pre-commit and .husky/pre-push. No other files. No issue is linked because none was found for this symptom; the reason is stated here.

Contract and boundary impact

  • Semantic owner and earliest changed stage: repository hooks.
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: Windows contributor workflow.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details: not applicable.
  • Generated metadata, package, or installation impact: none.

Expected effects:

  • Documentation or usability only; no target interaction.

Evidence and regression coverage

  • Base reproduction: on Windows 11 with Git for Windows 2.x, git commit failed with the Exec format error before the change; after it, commits run lint-staged ([STARTED] Running tasks for staged files... through [COMPLETED]) and complete. Recorded in the author's evidence log; no automated test is practical for a hook interpreter line.
  • Remaining proof gaps: none beyond the manual nature of the check.

Validation performed

  • git commit on Windows 11 (Ales) with the two hooks in place — lint-staged ran and the commit completed; repeated across many later commits.
  • head -1 .husky/pre-commit .husky/pre-push — both print #!/usr/bin/env sh.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: Windows 11 real; POSIX hosts unaffected by design.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none.

Author readiness

Human owner: @agnaylor

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/6346 **Author:** [@agnaylor](https://github.com/agnaylor) **Created:** 10/22/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr/husky-shebang` --- ### 📝 Commits (1) - [`06aa039`](https://github.com/morluto/rea/commit/06aa039b859ce13469a5101ff74ce2b619dbf176) fix(hooks): add a sh shebang so husky hooks run from Git Bash on Windows ### 📊 Changes **2 files changed** (+2 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `.husky/pre-commit` (+1 -0) 📝 `.husky/pre-push` (+1 -0) </details> ### 📄 Description ## Summary `git commit` and `git push` from Git Bash on Windows failed with `cannot spawn .husky/pre-commit: Exec format error` because the husky hook files have no interpreter line. Adding `#!/usr/bin/env sh` to both hooks lets Git run them on Windows; Linux and macOS are unaffected (husky invokes them through `sh` there either way). ## Problem and expected behavior Trigger: any commit in a source checkout on Windows with Git for Windows. Expected: the lint-staged pre-commit task runs as it does on Linux. ## Change and scope Two one-line additions, `.husky/pre-commit` and `.husky/pre-push`. No other files. No issue is linked because none was found for this symptom; the reason is stated here. ## Contract and boundary impact - Semantic owner and earliest changed stage: repository hooks. - Contribution scope fit and linked maintainer decision: not applicable. - CLI and MCP/tool-catalog contract: none. - Provider, bridge, target-format, or platform compatibility: Windows contributor workflow. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details: not applicable. - Generated metadata, package, or installation impact: none. Expected effects: - [x] Documentation or usability only; no target interaction. ## Evidence and regression coverage - Base reproduction: on Windows 11 with Git for Windows 2.x, `git commit` failed with the Exec format error before the change; after it, commits run lint-staged (`[STARTED] Running tasks for staged files...` through `[COMPLETED]`) and complete. Recorded in the author's evidence log; no automated test is practical for a hook interpreter line. - Remaining proof gaps: none beyond the manual nature of the check. ## Validation performed - `git commit` on Windows 11 (Ales) with the two hooks in place — lint-staged ran and the commit completed; repeated across many later commits. - `head -1 .husky/pre-commit .husky/pre-push` — both print `#!/usr/bin/env sh`. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: Windows 11 real; POSIX hosts unaffected by design. - Package or release metadata impact: none. - Security, privacy, process, or containment review: none. ## Author readiness Human owner: @agnaylor - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:46:49 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7294
No description provided.