From e237cf49951c6f7d971c0d7e01beda23d2276203 Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Sat, 4 Dec 2021 12:51:58 +0200 Subject: [PATCH] find-uncommitted script. List repositories that have uncommitted files or have no remote (so it haven't been pushed). Repositories that have WIP and it's local only. --- Documents/bin/find-uncomitted | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 Documents/bin/find-uncomitted diff --git a/Documents/bin/find-uncomitted b/Documents/bin/find-uncomitted new file mode 100755 index 0000000..3ea78d7 --- /dev/null +++ b/Documents/bin/find-uncomitted @@ -0,0 +1,10 @@ +#!/bin/sh +set -eu + +# shellcheck disable=SC2044 +for repo in $(find "$HOME/Repositories" -maxdepth 7 -type d -name .git -exec dirname {} \;) +do + [ "$(git -C "$repo" stat | wc -l)" -gt '1' ] || continue + [ "$(git -C "$repo" remote show | wc -l)" -gt 0 ] || continue + echo "$repo" +done -- GitLab