rhq 0.2.0

manages Git repositories
docs.rs failed to build rhq-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: rhq-0.2.8

rhq - Manages your local repositories

License: MIT Build Status Build status

rhq is a command-line repository management tool, written in Rust.

Overview

rhq provides a way to organize local repositories cloned by Git and other VCSs. You can use the command rhq clone as alternative of git clone, to clone remote repositories under a specific root directory with intuitive directory structure.

$ rhq clone ubnt-intrepid/rhq
# Equivalent to `git clone https://github.com/ubnt-intrepid/rhq.git ~/.rhq/github.com/ubnt-intrepid/rhq`
~/.rhq/
  |- github.com/
  |  |- ubnt-intrepid/
  |  |  `- rhq/         <- clones with intuitive directory structure
  |  `- user2/
  |     `- repo3/
  `- gitlab.com/
     `- user3/
        `- repo4/

rhq also provides a way to list the location of managed local repositories.

$ rhq list
/home/username/.rhq/github.com/ubnt-intrepid/rhq
/home/username/.zplug/repos/zsh-users/zsh-autosuggestions
...

Installation

The Rust toolchain is required. If you have already installed Rust toolchain:

$ cargo install rhq

Development version is available by using --git option as follows:

$ cargo install --git https://github.com/ubnt-intrepid/rhq.git

Commands

rhq clone [<query>] [--arg=<arg>] [-n | --dry-run]

Clone remote reposities into the local directory.

  • <query>
    A string to determine the URL of remote repository. Available formats are:

    • URL: (http|https|ssh|git)://github.com[:port]/username/repository.git
    • SCP-like pattern: git@github.com:username/repository.git
    • relative path and hosts: [github.com/]username/repository

    When omitting, rhq get the list of queries from standard input.

  • --arg=<arg>
    Supplemental arguments to pass git command.

  • -n | --dry-run
    Show message string, instead of actually performing Git command.

rhq list

List local repositories managed by rhq.

rhq foreach [-n | --dry-run] <command> [<args>...]

Execute commands into each local repositories.

  • <command>
    Command name
  • <args>...
    Supplemental arguments of command
  • -n | --dry-run
    Show message string, instead of actually performing Git command.

rhq completion <shell> [<out-file>]

Generate completion script for your shell. If out-file is omitted, dump scirpt to standard output.

  • <shell>
    Target shell name (value: bash, zsh, fish or powershell)
  • <out-file>
    Path to write completion script

Configuration

The behaviour of rhq can change by using configuration files. The location of configuration file is ~/.rhqconfig or ~/.config/rhq/config.

  • root - string
    The path of root directory to put in local repositories. The default value is ~/.rhq.

  • supplements - array of strings
    Supplemental directories for lookup local repositories.

See .rhqconfig for details.

Interface for Text Editors

Vim

mattn/ctrlp-ghq is available. If you are vim-plug user, try as follows:

Plug 'mattn/ctrlp-ghq'

let g:ctrlp_ghq_command = 'rhq'
let g:ctrlp_ghq_actions = [ { "label": "Open", "action": "Explore", "path": 0 } ]

noremap <Leader>g :<C-u>CtrlPGhq<CR>

Visual Studio Code

Extensions for Visual Studio Code is available. See here for details.

License

rhq is released under the MIT license. See LICENSE for details.

Similar projects