Ask HN: Anyone else write the commit message before they start coding?

25 points by xkapastel ↗ HN
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.

10 comments

[ 3.2 ms ] story [ 33.8 ms ] thread
I 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.
What 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)

Yep, great idea. Today I broke my work into a whole list of commit messages, then made the changes one by one.
I've found myself doing this lately too! Great approach.
No, but now I've read your question I'm definitely going to start and see how it works. It sounds like a great idea!
Sort 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.
Really like the idea, to avoid having a big commit fixing several things not related
I'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.

Love this. I’ve been using the readme driven development and press release driven strategy. Git message driven commit fits right in!