Skip to content

Instantly share code, notes, and snippets.

@kosmatov
Last active February 19, 2016 08:29
Show Gist options
  • Save kosmatov/153eebf3d27dbec41a4a to your computer and use it in GitHub Desktop.
Save kosmatov/153eebf3d27dbec41a4a to your computer and use it in GitHub Desktop.
$ cat .git/hooks/commit-msg
#!/bin/sh
ticket=`cat $1 | grep "PROJ-"`
if [ -z "${ticket}" ]; then
ticket_num=`git branch | grep "*" | grep -o "[0-9]*"`
if [ ${ticket_num} -gt 10 ]; then
echo "$(cat $1) PROJ-${ticket_num}" > $1
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment