Skip to content

Instantly share code, notes, and snippets.

@santiycr
Created December 18, 2012 15:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save santiycr/4328787 to your computer and use it in GitHub Desktop.
Save santiycr/4328787 to your computer and use it in GitHub Desktop.
Git commit hook to automatically add your Selenium wiki name to every commit.
#!/bin/bash
# Automatically adds your Selenium wiki name in case it's missing
# Place in selenium/.git/hooks
# chmod +x selenium/.git/hooks/commit-msg
# Append 'export SELENIUM_WIKI_NAME="YourWikiName"' to your bashrc/zshrc
echo "Checking commit message..."
if [ -z "$(grep -e "^$SELENIUM_WIKI_NAME: " $1)" ]; then
echo "Missing Wiki name in commit message, appending"
echo "$SELENIUM_WIKI_NAME: $(cat $1)" > $1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment