When user provides two commit IDs (in any order or format), analyze the changes between them:
git cat-file -t for each commit IDgit log -1 --format=fuller for both commitsgit diff .. (chronological order)git diff --stat .. Present the analysis with:
# Validate commits exist
git cat-file -t <commit-id>
# Get full commit info
git log -1 --format="Hash: %H%nAuthor: %an%nDate: %ad%nMessage: %s%n" <commit-id>
# Chronological diff (older..newer)
git diff <older-commit>..<newer-commit>
# Diff stat
git diff --stat <older-commit>..<newer-commit>
# Show files changed
git diff --name-only <older-commit>..<newer-commit>
git log to see recent commitsAccept various formats:
abc123def456...abc123d (at least 7 chars)HEAD~5=== Commit A ===
Hash: abc123...
Author: John Doe
Date: 2024-01-15 10:30:00
Message: feat: add user login
=== Commit B ===
Hash: def456...
Author: Jane Smith
Date: 2024-01-20 14:45:00
Message: fix: resolve auth bug
=== Changes Summary ===
5 files changed, 120 insertions(+), 35 deletions(-)
=== File Breakdown ===
Modified: src/auth.js, src/login.html
Added: src/auth-utils.ts
Deleted: src/old-auth.php
=== Diff ===
... (detailed diff output)
共 1 个版本