I’m in the midst of preparing some SCM guidelines for our Subversion users and came across a point of contention with the team. Is there ever a valid use case for someone to make consecutive commits with identical messages?
If you take the approach that a commit message should describe the “what” and “why” of code changes it’s difficult to see a valid case for this. Looking at our history, the instances where this has happened appear to be more out of convenience than anything else and really don’t tell the story of what the code is doing.
Does anyone have any views on the legitimacy of this? Would guidelines (or even pre-commit hooks) be overzealous or is it a reasonable expectation?
Edit: let’s work with the assumption that people are already leaving good commit messages. IMHO, a single word like “updated” or “typo” does not constitute a satisfactory commit message. I would expect to see something more like “Updated colour of submit button to green” or “Fixed typo in instructional copy”. It’s very difficult just to browse a repository log and understand what’s going on in a project without drilling into individual commits if the message is a word or two.
I guess it is the kind of problem that a technical solution cannot answer. You can always find cases that either are valid and the tool will forbid or the opposite.
One example of commit message I use quite often and tells all the story:
typo
The best solution is not technical. It is social engineering. Talk to your team.
I usually write very high-abstraction commit messages, because I don't really see the point of telling the same story that the diff does. That sometimes results in identical consecutive commit messages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With