Skip to content

Instantly share code, notes, and snippets.

@mattdangerw
Created February 19, 2014 03:04
Show Gist options
  • Save mattdangerw/9085326 to your computer and use it in GitHub Desktop.
Save mattdangerw/9085326 to your computer and use it in GitHub Desktop.
commit hook
#!/bin/bash
# move this script to the .git/hooks directory for your repo. or to a global
# git template directory. make sure to chmod +x this file
branch=`git rev-parse --abbrev-ref HEAD`
for repo in "sdk" "shell"; do
if [[ $branch == $repo/* ]]; then
number=`echo $branch | awk -F/ '{print $2}'`
link="[endlessm/eos-$repo#$number]"
grep -Fq "$link" $1 || {
echo "issue link: $link"
echo $link >> $1
}
fi
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment