feat: add git hook integration for automatic commit message generation#29
Merged
Conversation
137d203 to
b1468e7
Compare
Add `gitai hook install`, `gitai hook uninstall`, and `gitai hook status` commands that manage a prepare-commit-msg git hook. When installed, the hook automatically runs gitai to generate commit messages when users run `git commit` without -m. Existing hooks are preserved by appending rather than overwriting. Set GITAI_SKIP_HOOK=1 to bypass. https://claude.ai/code/session_015TK3iaRdi1a2BEE9gjxxrX
Wrap all errors returned from external packages (os, hook) with fmt.Errorf to satisfy the wrapcheck golangci-lint rule. https://claude.ai/code/session_015TK3iaRdi1a2BEE9gjxxrX
- Replace fmt.Errorf with errors.New for constant error strings (SA1006) - Use stdout.String() instead of string(stdout.Bytes()) (S1030) - Remove always-nil error return from resolveRelativePaths (unparam) - Use t.Fatal instead of t.Error before pointer dereference (SA5011) - Fix TestDefaultModel to use actual DefaultModel constant - Fix tests to accept "command not found" when gemini binary is absent https://claude.ai/code/session_015TK3iaRdi1a2BEE9gjxxrX
b1468e7 to
9f185ea
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
gitai hook install,gitai hook uninstall, andgitai hook statuscommands that manage a prepare-commit-msg git hook. When installed, the
hook automatically runs gitai to generate commit messages when users run
git commitwithout -m. Existing hooks are preserved by appending ratherthan overwriting. Set GITAI_SKIP_HOOK=1 to bypass.