Closed etorreborre closed 11 months ago
Hi @etorreborre 👋🏻
Thanks for the idea! I'm not familiar with the cmt
tool but it looks cool! 🚀
I'm hesitant to reimplement an entire templating tool here and I personally don't use commit templates. If you have a .cmt
commit template, can't you just use cmt
instead of zbg commit
?
On a separate note, I discovered that git
itself supports commit templates natively via the commit.template
option in .gitconfig
:
It might not be as flexible and powerful as cmt
but IMO it's more portable and makes your workflow more universal.
Since zbg commit
without arguments will call git add .
followed by git commit
, the latter will use commit.template
and you can go from here.
Would it be enough?
My company is currently using (and enforcing) commit messages along the conventialcommits format. This is where cmt
is useful. There's less chance of a making a mistake, and it saves some typing when prefixing the message with refactor(rust)
.
Thanks for the pointer on git commit templates, I didn't know that such a thing existed. I will experiment with it. I totally understand why you would not want to re-implement a template system, no worries.
One thing that I miss with
zbg
is a way to format the commit message like with thecmt
Haskell tool.zbg new
already goes in the direction of having some convention for branch names (with theuser.login
prefix), I think it would be good to go one step further with commit messages. This could be totally optional:.cmt
file is defined locally, use that file as a template for the commit message (see the cmt demo).cmt
file then let the user type a regular commit message.