Skip to content

git-story: register git pre-commit hook - #3104

Merged
Dominic Nguyen (datduyng) merged 2 commits into
mainfrom
domnguyen/git-story-pre-commit-hook
Sep 30, 2026
Merged

Dominic Nguyen (datduyng) merged 2 commits into
mainfrom
domnguyen/git-story-pre-commit-hook

Conversation

@datduyng

@datduyng Dominic Nguyen (datduyng) commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor
#!/bin/sh
# git-story hook
exec git-story hooks git pre-commit "$@"

exec passes git's hook arguments and stdin to git story hooks git pre-commit unchanged. The handler reads stdin and prints a placeholder. Git runs hooks with sh on all platforms, including Git for Windows.

  • Uses git rev-parse --git-path, so core.hooksPath and worktrees work.
  • Does not overwrite a hook it did not write (marker line). It reports the hook and exits 1.

@datduyng
Dominic Nguyen (datduyng) changed the base branch from domnguyen/git-story to main September 29, 2026 23:39
@datduyng
Dominic Nguyen (datduyng) force-pushed the domnguyen/git-story-pre-commit-hook branch from 23b4f18 to d11891f Compare September 29, 2026 23:44
@datduyng
Dominic Nguyen (datduyng) marked this pull request as ready for review September 29, 2026 23:50
@datduyng
Dominic Nguyen (datduyng) added this pull request to the merge queue Sep 30, 2026
Merged via the queue into main with commit 739e112 Sep 30, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants