#git #repository #yank #operation #dashboard #parallel #directory

app git-yank

A CLI tool for updating multiple Git repositories in parallel

1 stable release

new 1.0.1 May 15, 2025

#1 in #yank

MIT license

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

  1. Scans the current directory for Git repositories
  2. 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
  3. Displays a live dashboard showing progress
  4. Provides a summary when complete

Architecture

The codebase is organized into several modules:

  • config: Configuration handling
    • types.rs: Configuration data structures
    • loader.rs: Configuration loading functionality
    • ignore.rs: Ignore list handling
  • git: Git operations and repository management
    • discovery.rs: Repository discovery and filtering
    • operations.rs: Git operations implementation
    • repository.rs: Repository data structures
  • ui: Terminal UI components
    • dashboard: Dashboard state and manipulation
    • events: UI event definitions
    • input_handler: User input processing
    • rendering: TUI rendering logic
    • terminal: Terminal setup and cleanup
    • ui_loop: Main UI loop
    • workers: Worker task management
  • worker: Parallel worker implementation
    • pool: Worker pool for task distribution
    • task: Individual worker implementation
    • messages: 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:

  1. Clone the repository
  2. Run cargo build to build the project
  3. Run cargo test to ensure tests pass
  4. Make your changes
  5. Run cargo clippy to check for any linting issues
  6. Submit a pull request

Dependencies

~18–30MB
~452K SLoC