By convention I create my story branches in git to include Jira issue ids in them, e.g. FOO-1001. I have a script to do that for me. Now, I have prepared another script that fetches the title of FOO-1001 from Jira API. I want to achieve that when I type:
$ git commit
My editor opens up prefilled with the following:
BUGFIX: FOO-1001 Some sample issue title downloaded using my script
What is the easiest way to achieve this using the scripts I described? My idea is to somehow format the commit message to a file so that git can find it and use as default. One way seems to be to use prepare-commit-msg
hook, but I would prefer to achieve my goal using a standalone script, without any configuration in .git
(so that my colleagues can easily reuse it).