Search code examples
gitgit-commitcommit-message

If git commit messages written in the imperative, how do I clarify what hasn't yet been done? 'Don't add hashing' or 'Didn't/Doesn't add hashing'?


I'm still not totally clear about the way git commit messages are supposed to be written.

I know the basic rules, but this one confused me. In my practice project, I created a login system and a user signup, but had not yet implemented secure password storage in the database. They were still being stored Sony style in plain text. I wanted to make a note of that in the commit message, but I found myself in a bizarre quandary about how to phrase that in the imperative.

Any thoughts?

I do think, personally, that this should be included in the commit message, even though it is a statement of what isn't included in the commit, because it represents important info for anyone wishing to use the code that may not be obvious by glancing at the changes.


Solution

  • One good article on commit message is How to Write a Git Commit Message.

    Its rule n° 5 indeed recommends using imperative mood.

    The imperative can sound a little rude; that's why we don't often use it. But it's perfect for git commit subject lines.
    One reason for this is that git itself uses the imperative whenever it creates a commit on your behalf.

    In the case of your topic, a simple "Doesn't add xxx" is enough to complete the first part of your commit (the "positive statement", in imperative).