← Back to context

Comment by chrismorgan

25 days ago

So often have I started writing a commit message about why I’d done something this way, and realised a problem or thought of another approach, and ended up throwing away the entire change and starting from scratch.

(Aside: you should probably write longer commit messages.)

Corollary: write the commit message first, implement things later! Not a joke, this is almost like TDD works. (TDD writes formal tests, which is much more involved.)

Second this. After having a chat with some coworkers, I've been attempting to write more thoughtful and longer commit messages. I had this exact experience yesterday after I had staged my commit and was writing the message. I realized that there was a better way to do this change and redid the whole thing.