Skip to content

Instantly share code, notes, and snippets.

@dvigne
Created May 21, 2024 13:54
Show Gist options
  • Save dvigne/d207496620b9073f15336388414f586c to your computer and use it in GitHub Desktop.
Save dvigne/d207496620b9073f15336388414f586c to your computer and use it in GitHub Desktop.
#!/bin/bash
TICKET=$(git symbolic-ref HEAD | rev | cut -d/ -f1 | rev | grep -o -E "[A-Z]+-[0-9]+")
if [[ -n "${TICKET}" ]]; then
sed -i.bak -e "1s/^/[${TICKET}] /" $1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment