-
Notifications
You must be signed in to change notification settings - Fork 73
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Description
Add a --repo flag that allows users to automatically clone and replay commits from any GitHub repository without manually cloning it first.
Motivation
Users should be able to quickly explore interesting repositories without the overhead of:
- Manually finding a suitable directory
- Cloning the repository
- Navigating to it
- Running gitlogue
This feature would make gitlogue more accessible for:
- Exploring popular open-source projects
- Presentations and demos
- Educational purposes
- Quick previews of project history
Proposed Solution
Usage
# Short GitHub notation
gitlogue --repo ratatui-org/ratatui
# Full GitHub URL
gitlogue --repo https://github.com/rust-lang/rust
# Git URL
gitlogue --repo [email protected]:tokio-rs/tokio.gitImplementation Details
-
Repository Parsing
- Parse various Git URL formats
- Extract owner/repo from GitHub URLs
- Support GitHub shorthand notation (e.g.,
owner/repo)
-
Caching Strategy
- Clone to
~/.cache/gitlogue/repos/<owner>/<repo> - Check if repository already exists before cloning
- Optionally
git pullto update existing clones - Add
--force-cloneflag to force re-clone
- Clone to
-
Git Operations
- Use
git2crate for cloning (already a dependency) - Show progress during clone operation
- Handle authentication for private repos (optional)
- Support shallow clones for faster downloads (
--depth 1)
- Use
-
CLI Design
# Basic usage
gitlogue --repo owner/repo
# With options
gitlogue --repo owner/repo --theme nord --speed 20
# Force update
gitlogue --repo owner/repo --force-clone
# Shallow clone
gitlogue --repo owner/repo --shallow
# Specific commit from remote repo
gitlogue --repo owner/repo --commit abc123Example Implementation
#[derive(Parser, Debug)]
pub struct Args {
// ... existing fields
#[arg(
short = 'r',
long,
value_name = "REPO",
help = "Clone and replay a GitHub repository (e.g., owner/repo or https://github.com/owner/repo)"
)]
pub repo: Option<String>,
#[arg(
long,
help = "Force re-clone even if repository exists in cache"
)]
pub force_clone: bool,
#[arg(
long,
help = "Perform shallow clone (--depth 1) for faster downloads"
)]
pub shallow: bool,
}Benefits
- Easier onboarding - New users can try gitlogue immediately
- Demos and presentations - Quick setup for showcasing features
- Education - Explore how popular projects evolved
- Discovery - Browse commit histories of interesting projects
- Parity with GitType - GitType already has this feature
Repository Cache Management
Future enhancements could include:
# List cached repositories
gitlogue repo list
# Remove cached repository
gitlogue repo remove owner/repo
# Clear all cache
gitlogue repo clear
# Update all cached repos
gitlogue repo updateReferences
- GitType implementation: https://github.com/unhappychoice/gittype (has
--repoflag) - git2-rs documentation: https://docs.rs/git2/latest/git2/
- Repository caching similar to cargo's
~/.cargo/registry
Related Issues
- fix: track Cargo.lock and update installation docs #45 (this would make exploring shell script repos easier once shell highlighting is added)
Additional Context
This feature would significantly improve the user experience and make gitlogue more accessible for exploring the Git history of any public repository on GitHub.
nicokosi and joelbarmettlerUZHWolfsrudel
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request