Skip to content

Make BlitzForge Git hooks portable across contributor environments#30

Merged
CoreyRDean merged 1 commit into
developfrom
fix/cross-platform-git-hooks
May 12, 2026
Merged

Make BlitzForge Git hooks portable across contributor environments#30
CoreyRDean merged 1 commit into
developfrom
fix/cross-platform-git-hooks

Conversation

@CoreyRDean
Copy link
Copy Markdown
Collaborator

@CoreyRDean CoreyRDean commented May 12, 2026

Non-technical summary

This makes BlitzForge's shipped local Git hooks usable across contributor environments instead of only on Windows shells. Contributors can now opt into the repo hooks with one Git config command, and the README explains what those hooks actually do.

Why this matters now: the live develop docs said the full test suite ran as a local pre-commit hook, but on macOS the hook immediately failed because it hard-called cmd.exe, and the post-commit cleanup logic depended on GNU-only shell behavior. That made the contributor workflow claim stronger than the implementation.

After this change, the system is better because the documented local hook workflow is honest, cross-platform, and reproducible for fresh clones.

Technical summary

  • Reworked .hooks/pre-commit to resolve the repo root and dispatch to test.bat on Windows shells or test.sh on Unix-like hosts.
  • Reworked .hooks/post-commit to use portable Bash + awk cleanup instead of GNU-specific sed -i and head -c -1 behavior.
  • Made the post-commit cleanup handle root commits and skip deleted files safely.
  • Updated ReadMe.md to document git config core.hooksPath .hooks, explain the shipped hook behavior, and stop implying hooks are automatic.
  • Breaking changes: none.

Additional notes

  • Trade-off: this keeps the existing hook model instead of introducing a dedicated hook installer script, which keeps the increment small and aligned with the current repo structure.
  • Deferred follow-up: if the project wants hooks enabled automatically for all contributors, a bootstrap/setup command would be the next step.
  • Remaining gap: the Windows batch path was validated by dispatch logic and existing script compatibility, but not executed live in this macOS environment.

@CoreyRDean CoreyRDean added bug Something isn't working documentation Improvements or additions to documentation labels May 12, 2026
@CoreyRDean CoreyRDean marked this pull request as ready for review May 12, 2026 16:34
@CoreyRDean CoreyRDean requested a review from a team as a code owner May 12, 2026 16:34
@CoreyRDean CoreyRDean merged commit 2ce2fb3 into develop May 12, 2026
4 checks passed
@CoreyRDean CoreyRDean deleted the fix/cross-platform-git-hooks branch May 12, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant