Skip to content

aiskillstore/marketplace / skills/1natsu172/git-analysis

git-analysis

Verified

Analyze git repository changes, branch differences, and commit history. Use when analyzing branches, comparing changes, examining commit history, or preparing for PR/commit operations.

FileKindSize
REFERENCE.mdmarkdown10.0 KB
SKILL.mdskill md5.4 KB
scripts/get_branch_diff.shscript1.6 KB
scripts/get_commit_history.shscript1.1 KB
skill-report.jsonconfig97.7 KB

scripts/get_commit_history.sh

View on GitHub
#!/usr/bin/env bash
#
# get_commit_history.sh
#
# Extracts detailed commit history in structured format from merge base to HEAD.
#
# Usage: bash get_commit_history.sh [merge-base]
#
# If merge-base is not provided, it will be automatically determined.
#
# Output format (one commit per line):
#   hash|subject|author_name|author_email|date

set -euo pipefail

# Check if in git repository
if ! git rev-parse --git-dir > /dev/null 2>&1; then
    echo "Error: Not in a git repository" >&2
    exit 1
fi

MERGE_BASE="$1"

# If merge base not provided, determine it automatically
if [ -z "$MERGE_BASE" ]; then
    DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo "main")
    MERGE_BASE=$(git merge-base origin/"$DEFAULT_BRANCH" HEAD 2>/dev/null || echo "")

    if [ -z "$MERGE_BASE" ]; then
        echo "Error: Could not determine merge base" >&2
        exit 1
    fi
fi

# Get structured commit history
# Format: hash|subject|author_name|author_email|date
git log --format="%H|%s|%an|%ae|%ad" --date=iso "$MERGE_BASE"..HEAD
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall