| Crates.io | garch |
| lib.rs | garch |
| version | 0.1.0 |
| created_at | 2025-08-24 03:21:51.702344+00 |
| updated_at | 2025-08-24 03:21:51.702344+00 |
| description | Git Archaeology - Explore the evolution of code through git history interactively |
| homepage | https://github.com/wyattlamberth/garch |
| repository | https://github.com/wyattlamberth/garch |
| max_upload_size | |
| id | 1808050 |
| size | 77,105 |
A command-line tool for exploring git history as an interactive timeline. Navigate through every version of your code to understand how it evolved, who wrote what, and why changes were made.
Most files exist only in the present moment - you can't step back through time to see how they evolved. But git gives code an extra dimension: a traversable timeline of every change. garch makes this timeline accessible and intuitive to explore with an interactive terminal interface.
git clone https://github.com/yourusername/garch
cd garch
cargo install --path .
Navigate through the complete history of a file:
# View entire file history
garch file src/main.rs
# View file history starting from newest commits
garch file src/auth.rs --reverse
Explore the evolution of specific lines:
# View evolution of lines 10-20
garch lines src/auth.rs:10-20
# View evolution of a single line
garch lines src/main.rs:45
# View lines starting from newest commits
garch lines lib.py:100-150 --reverse
# Basic commands
garch file <filepath> # View entire file history
garch lines <filepath:start-end> # View specific line range
garch lines <filepath:linenumber> # View single line
# Options
--reverse, -r # Start with newest commits first
--help # Show detailed help
The terminal interface provides intuitive navigation:
Each view shows:
filename.rs | 5 of 12 | 2024-01-15 14:30:22
abc1234 | Added error handling and validation
┌─ alice.smith (2024-01-15) [abc1234] Added error handling
│ 45 │ if let Some(error) = result.err() {
│ 46 │ log::error!("Processing failed: {}", error);
│ 47 │ return Err(error);
│ 48 │ }
┌─ bob.jones (2024-01-20) [def5678] Improved error messages
│ 49 │ log::info!("Operation completed successfully");
│ 50 │ Ok(result)
Code Archaeology: Understand why code exists by seeing its evolution and decision points.
Onboarding: New team members can trace complex code back to its origins and reasoning.
Debugging: Find when bugs were introduced by following the timeline of changes.
Code Reviews: Understand the historical context behind current implementations.
Learning: Study how codebases evolve and how experienced developers iterate on solutions.
garch leverages existing git commands rather than reimplementing git functionality:
git log -L to get commits that touched specific linesgit blame --line-porcelain to get authorship data for each linegit show to extract actual diff contentThis approach ensures compatibility with all git repositories and takes advantage of git's optimized history traversal.
# You found a bug in user_service.py - view the entire file
garch file src/user_service.py
# Or focus on the problematic lines
garch lines src/user_service.py:120-135
# Navigate with ← → to see:
# - When the bug was introduced
# - Who wrote the code and their commit message
# - How the code looked before the bug
# - What changes were made over time
# You're looking at a confusing algorithm
garch file src/complex_algorithm.py
# Or focus on the specific complex function
garch lines src/complex_algorithm.py:45-80
# Step through the history to see:
# - How it started (probably much simpler)
# - What requirements drove the complexity
# - Who worked on different sections
# - The evolution of the approach
# Before reviewing changes to authentication logic
garch file src/auth/validator.rs
# Or examine specific authentication functions
garch lines src/auth/validator.rs:25-60
# Navigate through commits to understand:
# - Previous approaches that were tried
# - Why certain design decisions were made
# - Historical context for current implementation
# - Who has expertise in this area
# Study how a configuration file evolved
garch file config/database.yml
# See API endpoint changes over time
garch lines src/api/users.rs:100-200 --reverse
# Understand the progression:
# - Simple initial implementation
# - Performance optimizations added over time
# - Bug fixes and edge case handling
# - Refactoring and architectural changes
git log -L and git blame --line-porcelain (maximum compatibility)# Clone and build
git clone https://github.com/yourusername/garch
cd garch
cargo build
# Run tests
cargo test
# Run with debug output
RUST_LOG=debug cargo run -- lines src/main.rs:1-10
MIT License - see LICENSE file for details
Git + Archaeology = garch. It's short, memorable, and captures the essence of digging through code history to understand the present.