Starting to use Uniglot for hooks standardization.

This commit is contained in:
2022-04-30 23:14:56 -05:00
parent ce2e2d3863
commit f034d627a6
17 changed files with 234 additions and 11 deletions

17
Hooks/pre-receive Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
# Check each commit
while read oldrev newrev refname; do
# Thanks to https://blog.developer.atlassian.com/stop-foxtrots-now/ for the inspiration
if [ "$refname" == "refs/heads/main" ]; then
match=`git log --first-parent --pretty='%H %P' $oldrev..$newrev |
grep $oldrev |
awk '{ print $2 }'`
if [ "$oldrev" != "$match" ]; then
echo "Foxtrot detected. Please `git rebase origin/main`."
exit 1
fi
fi
done