gg log

Display commit history with optional AI analysis.

Usage

bash
gg log                # Show last 10 commits
gg log -n 20 --ai     # Show 20 commits with AI analysis
gg log --graph        # Show with visual graph

Options

OptionDescription
-n <count>Number of commits to show (default: 10)
-g, --graphShow commit graph
--aiGenerate AI analysis of commit history
--no-aiDisable AI analysis
-d, --dry-runShow what would be executed

AI Analysis

When using the --ai flag, GitGuru provides intelligent insights about your commit history:

  • Development patterns - How work is distributed over time
  • Key themes - Common topics in recent commits
  • Commit quality assessment - How well commits follow best practices
  • Recommendations - Suggestions for improvement
bash
$ gg log -n 20 --ai

šŸ“œ Commit History Analysis
────────────────────────────────────────────────────────────

Recent Commits (20):
  abc1234 feat: add user authentication
  def5678 fix: resolve login redirect issue
  ghi9012 docs: update API documentation
  ...

šŸ¤– AI Analysis:
────────────────────────────────────────────────────────────

Development Patterns:
  • Active development on authentication feature
  • Regular bug fixes following feature commits
  • Good documentation updates

Key Themes:
  • User authentication (40%)
  • Bug fixes (30%)
  • Documentation (20%)
  • Refactoring (10%)

Commit Quality: Good āœ“
  • Using conventional commit format
  • Descriptive messages
  • Focused changes

Recommendations:
  šŸ’” Consider adding more tests alongside features
  šŸ’” Some commits could be more atomic

Examples

Basic Usage

bash
# Show last 10 commits
gg log

# Show last 50 commits
gg log -n 50

# Show with graph visualization
gg log --graph

With AI Analysis

bash
# Analyze recent history
gg log --ai

# Analyze more commits for better patterns
gg log -n 50 --ai
Pattern Detection
For the best AI analysis, use -n 30 or higher. More commits give the AI better context to identify patterns and trends.

Visual Graph

The --graph option shows a visual representation of your branch structure:

bash
$ gg log --graph

* abc1234 (HEAD -> main) feat: add dashboard
* def5678 Merge branch 'feature/auth'
|\
| * ghi9012 feat: complete login flow
| * jkl3456 feat: add auth middleware
|/
* mno7890 initial commit

Use Cases

Morning Team Review

bash
# See what the team did yesterday
gg log -n 30 --ai

Pre-Merge Review

bash
# Review commits before merging
gg log --graph
gg log -n 10 --ai

Find Specific Commits

bash
# Use gg ask for specific queries
gg ask "find commits that changed login.ts"
gg ask "show commits by John from last week"
  • gg diff - View changes in detail
  • gg status - Current repository status
  • gg ask - Query commit history with natural language