Skip to content

Instantly share code, notes, and snippets.

@Chocimier
Created January 16, 2019 11:47
Show Gist options
  • Save Chocimier/7fa9d4125fe91746f0f3521a5feb3fb9 to your computer and use it in GitHub Desktop.
Save Chocimier/7fa9d4125fe91746f0f3521a5feb3fb9 to your computer and use it in GitHub Desktop.
void-packages commit-msg
#!/bin/sh
# commit-msg hook
if grep -q 'update to' "$1"; then
if git diff --staged | grep -qP '^( |\+)revision=1$'; then
:
else
echo 'On update, revision need to be 1. ~hook'
exit 1
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment