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.git
Implementation 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 pull to update existing clones
- Add
--force-clone flag to force re-clone
-
Git Operations
- Use
git2 crate for cloning (already a dependency)
- Show progress during clone operation
- Handle authentication for private repos (optional)
- Support shallow clones for faster downloads (
--depth 1)
-
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 abc123
Example 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 update
References
Related Issues
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.
Description
Add a
--repoflag 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:
This feature would make gitlogue more accessible for:
Proposed Solution
Usage
Implementation Details
Repository Parsing
owner/repo)Caching Strategy
~/.cache/gitlogue/repos/<owner>/<repo>git pullto update existing clones--force-cloneflag to force re-cloneGit Operations
git2crate for cloning (already a dependency)--depth 1)CLI Design
Example Implementation
Benefits
Repository Cache Management
Future enhancements could include:
References
--repoflag)~/.cargo/registryRelated Issues
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.