]>
code.delx.au - dotfiles/blob - .git-hooks-global/prepare-commit-msg
7 function is_new_commit
{
8 test -z "$(head -n1 "$FILENAME")"
11 function insert_issue_key
{
13 issue_key
="$(git symbolic-ref -q HEAD | grep -o "[A-Z
]\
+-[0-9]\
+" | head -n1 || true)"
14 if [ -n "$issue_key" ]; then
15 sed -i "1i${issue_key}: " "$FILENAME"
19 if is_new_commit
; then