-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitconfig_aliases
More file actions
14 lines (14 loc) · 3.18 KB
/
gitconfig_aliases
File metadata and controls
14 lines (14 loc) · 3.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
[alias]
cz = "!npx git-cz"
aicommit = "!f() { CONTEXT=\"${1:-}\"; PROMPT='Generate ONLY a one-line Git commit message in English, using imperative mood, summarizing what was changed and why, based strictly on the contents of `git diff --cached`. Do not add explanation or a body. Output only the commit summary line.'; if [ -n \"$CONTEXT\" ]; then PROMPT=\"$CONTEXT. $PROMPT\"; fi; COMMITMSG=$(claude --model haiku -p \"$PROMPT\"); git commit -m \"$COMMITMSG\" -e; }; f"
aicommit-ja = "!f() { CONTEXT=\"${1:-}\"; PROMPT='Generate ONLY a one-line Git commit message in Japanese, using imperative mood, summarizing what was changed and why, based strictly on the contents of `git diff --cached`. Do not add explanation or a body. Output only the commit summary line.'; if [ -n \"$CONTEXT\" ]; then PROMPT=\"$CONTEXT. $PROMPT\"; fi; COMMITMSG=$(claude --model haiku -p \"$PROMPT\"); git commit -m \"$COMMITMSG\" -e; }; f"
cz-aicommit = "!f() { CONTEXT=\"${1:-}\"; PROMPT='Based strictly on the contents of `git diff --cached`, generate a Commitizen commit type and a plain one-line English subject in imperative mood. The type must be exactly one of: feat, fix, chore, refactor, docs, test, ci, perf, style. Do not include any conventional commit prefix in the subject. Do not add explanation or a body. Output only one line in the exact format type|subject.'; if [ -n \"$CONTEXT\" ]; then PROMPT=\"$CONTEXT. $PROMPT\"; fi; RESULT=$(claude --model haiku -p \"$PROMPT\"); TYPE=${RESULT%%|*}; SUBJECT=${RESULT#*|}; case \"$TYPE\" in feat|fix|chore|refactor|docs|test|ci|perf|style) ;; *) echo \"Invalid commit type: $TYPE\" >&2; exit 1 ;; esac; if [ -z \"$SUBJECT\" ] || [ \"$SUBJECT\" = \"$RESULT\" ]; then echo \"Failed to parse commit subject: $RESULT\" >&2; exit 1; fi; npx git-cz --type \"$TYPE\" --subject \"$SUBJECT\"; }; f"
aibranch = "!f() { CONTEXT=\"${1:-}\"; PROMPT='Generate ONLY a oncise Git branch name in English, using kebab-case, that summarizes the purpose of the changes staged for commit based strictly on the contents of `git diff --cached`. Do not add explanation. Output only the branch name.'; if [ -n \"$CONTEXT\" ]; then PROMPT=\"$CONTEXT. $PROMPT\"; fi; BRANCHNAME=$(claude --model haiku -p \"$PROMPT\"); echo \"$BRANCHNAME\"; }; f"
# Add Co-authored-by trailer to the last commit
# Usage: git coauthor "Agent Name (model)" "email@example.com"
coauthor = "!f() { NAME=\"${1:-}\"; EMAIL=\"${2:-}\"; if [ -z \"$NAME\" ] || [ -z \"$EMAIL\" ]; then echo 'Usage: git coauthor <name> <email>' >&2; exit 1; fi; git commit --amend --no-edit --trailer \"Co-authored-by: $NAME <$EMAIL>\"; }; f"
# Usage: git coauthor-claude [model] (default: claude-opus-4-6)
coauthor-claude = "!f() { MODEL=${1:-claude-opus-4-6}; git commit --amend --no-edit --trailer \"Co-authored-by: Claude Code ($MODEL) <noreply@anthropic.com>\"; }; f"
coauthor-copilot = "!git commit --amend --no-edit --trailer 'Co-authored-by: GitHub Copilot <copilot[bot]@users.noreply.github.com>'"
coauthor-codex = "!git commit --amend --no-edit --trailer 'Co-authored-by: Codex CLI <codex[bot]@users.noreply.github.com>'"
coauthor-gemini = "!git commit --amend --no-edit --trailer 'Co-authored-by: Gemini CLI <gemini-cli[bot]@users.noreply.github.com>'"