aboutsummaryrefslogtreecommitdiff
path: root/bin/grc
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-01 17:02:30 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-01 17:02:42 +1200
commit5006146b111b01f4f2ed8ada273349de90ce54c0 (patch)
treeaabc36000af19176c51a78ddb9ce3af380d2fc33 /bin/grc
parentMention isgr(1) in fgscr(1) and gscr(1) man pages (diff)
downloaddotfiles-5006146b111b01f4f2ed8ada273349de90ce54c0.tar.gz
dotfiles-5006146b111b01f4f2ed8ada273349de90ce54c0.zip
Add grc(1)
Diffstat (limited to 'bin/grc')
-rwxr-xr-xbin/grc10
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/grc b/bin/grc
new file mode 100755
index 00000000..9a02d9da
--- /dev/null
+++ b/bin/grc
@@ -0,0 +1,10 @@
+#!/bin/sh
+# Argument or current dir is a Git repository with uncommitted changes
+cd -- "${1:-.}" || exit
+if ! isgr ; then
+ printf >&2 'grc: Not a Git repository\n'
+ exit 1
+fi
+isgr || exit
+[ -n "$(git ls-files --others --exclude-standard)" ] ||
+! git diff-index --quiet HEAD