aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Kavanagh <rak@debian.org>2018-06-01 13:52:40 -0400
committerRyan Kavanagh <rak@debian.org>2018-06-01 13:56:32 -0400
commit4ca4cf3c57f977978ab652f9fdbec7b626adc982 (patch)
treeb3aab3a3d6994dc0b49d938c5654ab6b7e7ffe7d
parentPager to rak.ac in mutt (diff)
Add a hook to make sure we don't accidentally commit a password
-rwxr-xr-x.githooks/post-commit9
-rwxr-xr-xdm2
2 files changed, 11 insertions, 0 deletions
diff --git a/.githooks/post-commit b/.githooks/post-commit
new file mode 100755
index 0000000..5752673
--- /dev/null
+++ b/.githooks/post-commit
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ $(git diff -G PASS -i HEAD~1..HEAD | wc -l) != 0 ]; then
+ echo "#######################################################"
+ echo "# You committed something containing the string PASS. #"
+ echo "# Please make sure this is safe before pushing. #"
+ echo "#######################################################"
+ git diff -G PASS -i HEAD~1..HEAD
+fi
diff --git a/dm b/dm
index e9e9229..2fb3424 100755
--- a/dm
+++ b/dm
@@ -2,6 +2,8 @@
set -e
+git config core.hooksPath .githooks
+
if [ ! -f SUBSTS.local ]; then
echo "Please create the file SUBSTS.local first."
exit 1;