4 ms·
Ask HN: Anyone else write the commit message before they start coding?
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.
- adrianlzt 8y agoReally like the idea, to avoid having a big commit fixing several things not related
- VermillionAzure 8y agoI 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.
- westurner 8y agoWhat 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)
- draw_down 8y agoNo
- conwy 8y agoYep, great idea. Today I broke my work into a whole list of commit messages, then made the changes one by one.
- ori9 8y agoI've found myself doing this lately too! Great approach.
- gumby 8y agoNo, but now I've read your question I'm definitely going to start and see how it works. It sounds like a great idea!
- karmakaze 8y agoSort 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.
- sethammons 8y agoI'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.
- andrei_says_ 8y agoLove this. I’ve been using the readme driven development and press release driven strategy. Git message driven commit fits right in!