cd
into a deliveroo repo directory- run:
curl -s https://gist.githubusercontent.com/scott-ad-riley/0d774a70452bd5bb118638b7dbed0176/raw/dde71f9489f2d01a6f048ec58d6f7f4cf93f63ce/prepare-commit-msg.rb > ./.git/hooks/prepare-commit-msg
- That downloads the script in this gist (I promise) and puts it in a
./git/hooks/prepare-commit-msg
file - You'll need to run this for each repo
N.B. It currently throws and prevents you from committing if your commit message starts with a different ticket number to the branch you're on (i.e. if you pass it PAY-1234: some message and you're on a branch that doesn't start PAY-1234/...
)
N.B.B It shouldn't care if you want to use xxx
as your commit message, aslong as it's at the beginning of your branch too.
If you can think of anything else that's worth adding (or if you don't like the guard against committing with the wrong ticket number let me know.