From e6909fb312bf9b0f9176fc09bcf385ba48138eee Mon Sep 17 00:00:00 2001 From: Peter Gill <38688162+jobodd@users.noreply.github.com> Date: Tue, 21 Jan 2025 20:30:41 +0000 Subject: [PATCH 1/3] Add README --- README | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..03f82ba --- /dev/null +++ b/README @@ -0,0 +1,80 @@ +# Recursive Git Status + +I got bored of running `ls -d */ | xargs -I {} sh -c "cd {} && git status"` all the time, and so `rgst` was born. + +`rgst` is a tool for showing the git status of multiple repositories at once; aiming to display all the things I +need to know about my git repos, without having to check on them each in turn. + + +## Installation + +go install github.com/jobodd/rgst/cmd/rgst@latest + +## Usage + +Basic usage calls rgst on the current directory, showing the current branch, number of commits ahead/behind the remote, as well as files added/modified/removed/unstaged. +```sh +$ rgst +|-- rgst develop ↑0 ↓0 +1 -0 ~0 U1 +```` + +`rgst` takes a single argument as a path, and optional flags +```sh +$ rgst --files ~/dev/rgst +|-- rgst develop ↑0 ↓0 +1 -0 ~0 U1 + |-- [AM] README +```` + +Run against a different directory, recurse one level down +```sh +$ rgst --depth 1 ~/dev/examples +|-- examples + |-- dbms + |-- mysql-server trunk ↑0 ↓993 +0 -0 ~0 U0 + |-- postgres master ↑0 ↓54 +2 -0 ~0 U2 + |-- sqlite master ↑0 ↓1 +0 -0 ~0 U0 + |-- languages + |-- go master ↑0 ↓0 +0 -0 ~0 U0 + |-- rust master ↑0 ↓192 +0 -0 ~0 U0 + |-- ziglings.org HEAD ↑0 ↓115 +0 -0 ~0 U0 +``` + +Filter directories with regex +```sh +$ rgst --depth 1 --regex lang ~/dev/examples +|-- examples + |-- languages + |-- go master ↑0 ↓0 +0 -0 ~0 U0 + |-- rust master ↑0 ↓192 +0 -0 ~0 U0 + +$ rgst --depth 1 --regex lang -v ~/dev/examples +|-- examples + |-- dbms + |-- mysql-server trunk ↑0 ↓993 +0 -0 ~0 U0 + |-- postgres master ↑0 ↓54 +2 -0 ~0 U2 + |-- sqlite master ↑0 ↓1 +0 -0 ~0 U0 + |-- ziglings.org HEAD ↑0 ↓115 +0 -0 ~0 U0 +``` + +See `--help` for additional flags +```sh +$ rgst --help +NAME: + Recursive git status - Check the status of Git repositories in subdirectories + +USAGE: + Recursive git status [global options] command [command options] + +COMMANDS: + help, h Shows a list of commands or help for one command + +GLOBAL OPTIONS: + --depth value, -d value Set the recursion depth to check for git repos. Max: 5 (default: 0) + --fetch, -f Fetch the latest changes from remote (default: false) + --fetch-all, Fetch the latest changes from remote, all branches (default: false) + --pull, -p Pull the latest changes from remote (default: false) + --files Show the list of files changed for each git directory (default: false) + --regex value, -e value Filter directories with an regular expression + --invert-match, -v Invert the regular expression match (default: false) + --help, -h show help +``` From ce6dcc78b9008cee9160f40350477bba77f905d9 Mon Sep 17 00:00:00 2001 From: Peter Gill <38688162+jobodd@users.noreply.github.com> Date: Tue, 21 Jan 2025 20:32:15 +0000 Subject: [PATCH 2/3] Fix README.md extension --- README => README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README => README.md (100%) diff --git a/README b/README.md similarity index 100% rename from README rename to README.md From 0459b9b8d41b8f3100a9d552fe4bc297a6339c51 Mon Sep 17 00:00:00 2001 From: Peter Gill <38688162+jobodd@users.noreply.github.com> Date: Tue, 21 Jan 2025 20:33:50 +0000 Subject: [PATCH 3/3] Remove sh for github markdown styling --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 03f82ba..ae7d115 100644 --- a/README.md +++ b/README.md @@ -13,20 +13,20 @@ go install github.com/jobodd/rgst/cmd/rgst@latest ## Usage Basic usage calls rgst on the current directory, showing the current branch, number of commits ahead/behind the remote, as well as files added/modified/removed/unstaged. -```sh +``` $ rgst |-- rgst develop ↑0 ↓0 +1 -0 ~0 U1 ```` `rgst` takes a single argument as a path, and optional flags -```sh +``` $ rgst --files ~/dev/rgst |-- rgst develop ↑0 ↓0 +1 -0 ~0 U1 |-- [AM] README ```` Run against a different directory, recurse one level down -```sh +``` $ rgst --depth 1 ~/dev/examples |-- examples |-- dbms @@ -40,7 +40,7 @@ $ rgst --depth 1 ~/dev/examples ``` Filter directories with regex -```sh +``` $ rgst --depth 1 --regex lang ~/dev/examples |-- examples |-- languages @@ -57,7 +57,7 @@ $ rgst --depth 1 --regex lang -v ~/dev/examples ``` See `--help` for additional flags -```sh +``` $ rgst --help NAME: Recursive git status - Check the status of Git repositories in subdirectories