1 stable release
new 1.0.1 | May 15, 2025 |
---|
#1 in #yank
98KB
2K
SLoC
Yank
A CLI tool for updating multiple Git repositories in parallel with a live text-mode dashboard.
Features
- Scan for Git repositories in the current directory
- Show repositories with their current status in a list, displaying all repositories upfront
- Press Enter on a repository to view detailed console output and Git activity logs
- Update multiple repositories in parallel with configurable worker count
- View progress and status in real-time with a rich TUI dashboard
- Configurable number of worker threads
- Detailed logging of all Git operations
- Interactive UI with keyboard navigation
- Graceful shutdown with Ctrl-C handling
- Error handling and recovery for problematic repositories
- Cross-platform support (Linux, macOS, Windows)
- Repository ignore lists via config or .yankignore files
Installation
From crates.io
cargo install yank
From source
git clone https://github.com/yourusername/yank.git
cd yank
cargo build --release
The compiled binary will be in target/release/yank
.
Usage
Simply run yank
in a directory containing Git repositories:
yank
Command Line Options
-w, --workers <WORKERS>
: Number of parallel workers (default: 4, use "0" for one worker per repo)-c, --config <CONFIG>
: Path to custom config file-i, --ignore <REPO>
: Ignore specific repositories (can be used multiple times)
Configuration
Yank can be configured using a YAML file at ~/.config/yank/yank.yaml
:
# Number of parallel workers (default: 4)
workers: 4
# Use unlimited workers (one per repository)
unlimited_workers: false
# List of repositories to ignore (fully qualified paths)
ignore:
- /path/to/repo1
- /path/to/repo2
Configuration Options
workers
: Number of parallel workers (default: 4)unlimited_workers
: Use one worker per repository (default: false)ignore
: List of repositories to ignore (by path)
Ignore Files
You can also create a .yankignore
file in the directory where you run yank to specify repository names to ignore:
# This is a comment
repo1
repo2
# Another comment
Empty lines and comments (lines starting with #) are ignored.
Keyboard Controls
- Up/Down or j/k: Navigate between repositories
- Enter: View detailed logs and console output for the selected repository
- Escape/Backspace: Return to list view from detailed view
- q: Quit the application
- Ctrl-C: Graceful shutdown (press twice to force quit)
How it Works
- Scans the current directory for Git repositories
- Processes each repository in parallel:
- Validates that it's a Git repository
- Fetches updates from all remotes
- Updates the local branch by rebasing on top of the remote changes
- Displays a live dashboard showing progress
- Provides a summary when complete
Architecture
The codebase is organized into several modules:
config
: Configuration handlingtypes.rs
: Configuration data structuresloader.rs
: Configuration loading functionalityignore.rs
: Ignore list handling
git
: Git operations and repository managementdiscovery.rs
: Repository discovery and filteringoperations.rs
: Git operations implementationrepository.rs
: Repository data structures
ui
: Terminal UI componentsdashboard
: Dashboard state and manipulationevents
: UI event definitionsinput_handler
: User input processingrendering
: TUI rendering logicterminal
: Terminal setup and cleanupui_loop
: Main UI loopworkers
: Worker task management
worker
: Parallel worker implementationpool
: Worker pool for task distributiontask
: Individual worker implementationmessages
: Worker communication
Changelog
Latest Changes
- Refactored configuration module for better maintainability
- Fixed parallel processing to process multiple repositories simultaneously
- Improved UI responsiveness with asynchronous repository updates
- Added detailed logging for each repository processing phase
- Fixed validation phase to display more information
- Improved error handling and recovery
- Added graceful shutdown with Ctrl-C handling
- Added support for ignoring repositories with .yankignore
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
When contributing code, please ensure it adheres to the existing code style and includes appropriate tests.
To set up the development environment:
- Clone the repository
- Run
cargo build
to build the project - Run
cargo test
to ensure tests pass - Make your changes
- Run
cargo clippy
to check for any linting issues - Submit a pull request
Dependencies
~18–30MB
~452K SLoC