Skip to content

Instantly share code, notes, and snippets.

#!/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'])