Skip to content

Instantly share code, notes, and snippets.

View romanosipenko's full-sized avatar

Roman Osipenko romanosipenko

  • Django Stars
  • Ukraine
View GitHub Profile
@romanosipenko
romanosipenko / pre-commit
Last active March 29, 2017 15:05
Git pre-commit hook to check alowance of making commit acording to autors/contributors file in repository.
#!/bin/sh
REPO_ROOT=`git rev-parse --show-toplevel`
AUTHORS_FILE="AUTHORS.txt"
if grep -xq "${GIT_AUTHOR_NAME} <${GIT_AUTHOR_EMAIL}>" "${REPO_ROOT}/${AUTHORS_FILE}"
then
exit 0;
else
echo "********************************************************************************"