Crates.io | mrh |
lib.rs | mrh |
version | 0.13.2 |
source | src |
created_at | 2017-09-04 23:49:55.905011 |
updated_at | 2024-03-25 14:30:52.910962 |
description | Crawls filesystem and displays pending status of each git repo found |
homepage | |
repository | https://github.com/tshepang/mrh |
max_upload_size | |
id | 30576 |
size | 70,984 |
This repo provides a library that allows crawling a directory and its children for Git repos. It reports if those repos have:
It also offers a command line tool with all those features, one of which is to show all repos:
$ mrh
foo (uncommitted changes, untracked files, unpushed commits)
bar
baz (untracked files)
qux
Only show those repos that are pending action:
$ mrh --pending
foo (uncommitted changes, untracked files, unpushed commits)
baz (untracked files)
Ignore untracked files in results:
$ mrh --pending --ignore-untracked
foo (uncommitted changes, unpushed commits)
Include repos whose HEAD commits are not tagged:
$ mrh --pending --ignore-untracked --untagged-head
foo (uncommitted changes, unpushed commits, untagged HEAD)
bar (untagged HEAD)
Check which repos have unfetched commits, a relatively slow operation when the remote is on the network:
$ mrh --access-remote ssh-key
qux (unfetched commits)
For cases where JSON output is desired, use --output-json
flag.
Ignores unreadable files/directories without warning
Ignores bare git repositories
You will need to first install a few packages before you can build mrh. On Debian/Ubuntu, here how you do:
apt install cmake libssl-dev pkg-config gcc
These are needed by the libssh2-sys crate, which itself is ultimately needed by the git2 crate.
Proceed to build and install mrh (assuming you have the Rust toolchain installed):
cargo install mrh
JSON output format is behind a feature flag:
cargo install mrh --features json
NOTE: minimum required rustc is v1.74, due to clap.
For library usage, check them API docs.