Skip to content

Instantly share code, notes, and snippets.

@dennisbyrne
dennisbyrne / commit_msg.py
Last active May 18, 2016 02:26
This commit-msg hook will copy the ticket number from your branch name and prepend it to your commit msg.
#!/usr/bin/python
# 1) copy this file to your computer
# 2) make this file executable: $ chmod +x /path/to/commit_msg.py
# 3) from the root of your local repo: $ ln -s /path/to/commit_msg.py .git/hooks/commit-msg
import sys
import subprocess
import re