Skip to content

Fast CLI tool for managing multiple Git repositories.

License

Notifications You must be signed in to change notification settings

ErickKramer/ripvcs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎒 ripvcs

PRE-RELEASE: Heavily developing this tool at the moment.

ripvcs (rv) is a command-line tool written in Go, providing an efficient alternative to vcstool for managing multiple repository workspaces.

Whether you are managing a few repositories or a complex workspace with numerous nested repositories, ripvcs (rv) offers the performance and efficiency you need to keep your workflow smooth and responsive.

🪄 Features

  • Enhanced Concurrency: Utilizes Go routines to manage multiple tasks simultaneously, ensuring optimal performance and reducing wait times.
  • Recursive Import: Supports recursive import functionality to automatically search for .repos files within directories to streamline the process of managed nested repositories dependencies.

🧰 Installation

Using pre-built binaries

  1. Go to the Releases page.
  2. Download latest binary based on architecture
  3. Rename the downloaded binary file to rv
  4. Make the binary executable
    chmod +x rv
  5. Move binary to a directory included in your PATH
    mv rv ~/.local/bin/
  6. Verify installation
    rv help

Build from source

  1. Clone repository
    git clone https://github.com/ErickKramer/ripvcs
    cd ripvcs
  2. Build binary
    go build -o rv main.go
  3. Follow steps 3-5 from the "Using pre-built binaries" section.

Usage

To check the available commands in rv simply run rv help:

rv help

Fast CLI tool for managing multiple Git repositories.

Usage:
  rv [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  export      Export list of available repositories
  help        Help about any command
  import      Import repositories listed in the given .repos file
  log         Get logs of all repositories.
  pull        Pull latest version from remote.
  status      Check status of all repositories
  switch      Switch repository version
  sync        Synchronize all found repositories.
  validate    Validate a .repos file
  version     Print the version number

Each of the available commands have their own help with information about their usage and available flags (e.g. rv help import).

Import repositories listed in the given .repos file

The repositories are cloned in the given path or in the current path.

It supports recursively searching for any other .repos file found at each
import cycle.

Usage:
  rv import <optional path> [flags]

Flags:
  -d, --depth-recursive int   Regulates how many levels the recursive dependencies would be cloned. (default -1)
  -f, --force                 Force overwriting existing repositories
  -h, --help                  help for import
  -i, --input .repos          Path to input .repos file
  -r, --recursive .repos      Recursively search of other .repos file in the cloned repositories
  -n, --retry int             Number of attempts to import repositories (default 2)
  -l, --shallow               Clone repositories with a depth of 1
  -w, --workers int           Number of concurrent workers to use (default 8)

Repositories file

repositories:
  demos:
    type: git
    url: https://github.com/ros2/demos
    version: jazzy
  stable_demos:
    type: git
    url: https://github.com/ros2/demos
    version: 0.20.4
  default_demos:
    type: git
    url: https://github.com/ros2/demos

Related Project

Shell completions

rv supports generating an autocompletion script for bash, fish, powershell, and zsh

For example, to configure to generate the completion for zsh do the following

rv completion zsh _ripvcs

Then, you need to place the completion file in the proper location to be loaded by your zsh configuration.

Afterwards, you should be able to do rv <TAB> to get autocompletion for the available commands and rv import -<TAB> to get autocompletion for the available flags.

Runtime comparison

I ran a quick comparison between rv and vcs using the valid_example.repos file for different commands using 8 workers.

Command vcs rv
import (overwrite) 2.363 s 1.753 s
import + skip 0.691 s 0.004 s
log 0.248 s 0.021 s
pull 0.635 s 0.417 s
status 0.238 s 0.035 s
validate 0.869 s 0.414 s

Future enhancements

  • Support tar artifacts
  • Support export command
  • Support custom git commands

About

Fast CLI tool for managing multiple Git repositories.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages