initial hook

This commit is contained in:
Marc BARBIER
2021-06-28 17:15:53 +02:00
commit ace5d23d8c
2 changed files with 32 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
applypatch-msg.sample
commit-msg.sample
fsmonitor-watchman.sample
post-update.sample
pre-applypatch.sample
pre-commit.sample
pre-merge-commit.sample
prepare-commit-msg.sample
pre-push.sample
pre-rebase.sample
pre-receive.sample
update.sample
Executable
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
git diff --staged | grep -v ^- | grep "console.log" 2> /dev/null 1> /dev/null
if [ $? = 0 ]
then
echo "${REDBOLD}/!\\Console.log detected /!\\"
echo "${REDBOLD}aborting..."
exit 1
else
echo "${GREENBOLD} No console.log"
fi
git diff --staged | grep -v ^- | grep "<<<<<<< HEAD" 2> /dev/null 1> /dev/null
if [ $? = 0 ]
then
echo "${REDBOLD}/!\\ UNRESOLVED MERGE DETECTED /!\\"
echo "${REDBOLD}aborting..."
exit 1
else
echo "${GREENBOLD} No unresolved merge"
fi