I keep finding myself forgetful to add #ticket refs to my posts. It is a pain. Usually I use at least one branch per ticket, or at least there can be several branches for one ticket, but usually this is not the other way around.
So, I was thinking about how to add the branch.ticket config parameter and then extract it from the prep-commit-msg file and add "refs #" to my post.
Perhaps after that, even adding a hook or an alias to ask #ticket when I create a new branch.
Can someone help me build them? I am new to git, and I am also not without a bash guru, but I can understand this if I pointed in the right direction.
I'm going to call now
git config --add branch.<branchname>.ticket <ticketnumber>
and then do something like
prepend `git config branch<branchname>.ticket` $file
basically. I think. Can anyone confirm this? and tell me how to get <branchname>?
source
share