Skip to content

Instantly share code, notes, and snippets.

@lmgarret
lmgarret / prepare-commit-msg
Last active July 6, 2021 07:33
prepare-commit-msg
#!/usr/bin/env python3
"""
Git hook to automatically insert in a git commit message an issue number
(e.g. Jira ticket number) from the current branch name.
"""
import itertools
import logging
import re
import sys