Skip to content

Instantly share code, notes, and snippets.

Stu Cox stucox

  • London, UK
View GitHub Profile
View prepare-commit-msg
#!/usr/bin/env python
"""
To enable save as /yourproject/.git/hooks/prepare-commit-msg and make executable: chmod +rx prepare-commit-msg
"""
import sys
from subprocess import check_output
def get_ticket_number():
branch_name = check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'])
You can’t perform that action at this time.