Git Summarize Changes
Produce a concise summary from <base_branch>..HEAD as the source of truth.
Base branch
- User-specified base branch, if given.
- Else default remote branch:
BASE_BRANCH="$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's|^origin/||')"
- If empty, ask the user for a base branch.
Workflow
- Run from repo root; validate branch and range from git (do not trust stale chat).
- Reuse chat context only if it matches current
<base_branch>..HEAD. - Draft markdown; copy to clipboard when possible; paste the same in chat.
Validate
git rev-parse --verify "$BASE_BRANCH" >/dev/null
git rev-parse --abbrev-ref HEAD
git log --oneline "$BASE_BRANCH"..HEAD
git diff --stat "$BASE_BRANCH"...HEAD
Empty range: say so; do not invent a summary.
Output template
## Summary
- <2-5 bullets on intent and impact>
Clipboard (macOS)
cat <<'EOF' | pbcopy
## Summary
- <final bullets>
EOF
If pbcopy fails, retry with needed permissions and still paste the markdown in chat.