diff --git a/.config/git/config b/.config/git/config index 13c51378ede7aad73ee152d63bc55574719edcc9..033d812582193966be00190c854c2fa5c6675bc9 100644 --- a/.config/git/config +++ b/.config/git/config @@ -19,7 +19,7 @@ merg = merge --no-edit pop = stash pop posh = push --set-upstream origin HEAD - pre-commit = ! pre-commit run --files $(git diff --name-only) $(git diff --cached --name-only) + pre-commit = ! pre-commit run --files $(git uncommitted) Pull = pull --progress --ff --tags pull-force = !git fetch && git reset --hard "$(git tracking)" pushes = !git remote | xargs -n1 git push diff --git a/Documents/bin/git-uncommitted b/Documents/bin/git-uncommitted new file mode 100755 index 0000000000000000000000000000000000000000..3439a5af80a6742afe8e4a800d524b528402972c --- /dev/null +++ b/Documents/bin/git-uncommitted @@ -0,0 +1,5 @@ +#!/bin/sh +set -eu + +git diff --name-only +git diff --name-only --cached diff --git a/Documents/bin/uncommitted b/Documents/bin/uncommitted new file mode 100755 index 0000000000000000000000000000000000000000..97e1d9fbc108532e0f1f7d7758c7edbd26aea185 --- /dev/null +++ b/Documents/bin/uncommitted @@ -0,0 +1,7 @@ +#!/bin/sh +set -eu + +# shellcheck disable=SC2016 +find ~/Repositories -maxdepth 5 -name .git -type d -print0 | + xargs --null dirname --zero | + xargs --null --replace /bin/sh -c 'f () { [ -z "$(git -C "$1" uncommitted)" -o -z "$(git -C "$1" remote -v)" ] || echo "$1"; }; f '\''{}'\'''