Skip to content

Instantly share code, notes, and snippets.

@ToadJamb
Last active August 29, 2015 14:21
Show Gist options
  • Select an option

  • Save ToadJamb/f6cfce866d3080e0f7c2 to your computer and use it in GitHub Desktop.

Select an option

Save ToadJamb/f6cfce866d3080e0f7c2 to your computer and use it in GitHub Desktop.
pre-commit author check
#!/bin/sh
BRANCH=$(git branch --list master)
AUTHOR=$(git config --global user.name)
echo ---------------------------------------------------------------
echo $AUTHOR
echo ---------------------------------------------------------------
if [ "$BRANCH" == '* master' ]; then
exec < /dev/tty
read -e -p "Is '$AUTHOR' the correct author? " author
if [ "$author" != 'yes' ]; then
exit 1
fi
fi
#!/bin/sh
BRANCH=$(git branch --list master)
AUTHOR=$(git config --global user.name)
echo ---------------------------------------------------------------
echo $AUTHOR
echo ---------------------------------------------------------------
if [ "$BRANCH" == '* master' ]; then
exec < /dev/tty
read -e -p "Is '$AUTHOR' the correct author (only 'yes' will allow commit)? " author
if [ "$author" != 'yes' ]; then
exit 1
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment