I feel like I just learned how to use Git: writing the message first thing has made me a lot more productive. I'm wondering if anyone else does this; I know test driven development is a thing, where people write tests before code, and this seems like a logical extension.
Ask HN: Anyone else write the commit message before they start coding?
1–10 of 11 posts
Re: Ask HN: Anyone else write the commit message before they start coding?
#2I know that people usually put down stories for Scrum or Agile and then they will list out "action steps" or "acceptance criteria" but this is a very smart way of tying it directly to work. This is brilliant! I look forward to trying this out.
Re: Ask HN: Anyone else write the commit message before they start coding?
#3What a great idea. Are you updating the commit message with `git commit --amend` until you squash and push, or writing a novel on the side?
BDD acceptance tests can be written in a pseudo-prose syntax (and ideally, executed)
Re: Ask HN: Anyone else write the commit message before they start coding?
#4No
Re: Ask HN: Anyone else write the commit message before they start coding?
#5Yep, great idea. Today I broke my work into a whole list of commit messages, then made the changes one by one.
Re: Ask HN: Anyone else write the commit message before they start coding?
#6I've found myself doing this lately too! Great approach.
Re: Ask HN: Anyone else write the commit message before they start coding?
#7No, but now I've read your question I'm definitely going to start and see how it works. It sounds like a great idea!
Re: Ask HN: Anyone else write the commit message before they start coding?
#8Sort of. As soon as I have something working locally that does the thing I set out to do, I commit it locally on a new branch with a WIP: commit message. I can then amend it with improvements or move on to adding more commits, each with a separate message.
Re: Ask HN: Anyone else write the commit message before they start coding?
#9Really like the idea, to avoid having a big commit fixing several things not related
Re: Ask HN: Anyone else write the commit message before they start coding?
#10I'm not following. Git is source control: the message should be tied to the code that went with the commit. Are you amending before pushing?
As for tdd, I don't see this as a logical extension (yet). My logical extension is document driven design. Write the api, get feedback on that, then make it work. I like to design from the outside in.