Over a million developers have joined DZone.

Choose Your Commit Messages Properly

· Java Zone

Check out this 8-step guide to see how you can increase your productivity by skipping slow application redeploys and by implementing application profiling, as you code! Brought to you in partnership with ZeroTurnaround.

I already wrote a couple of posts about version control stuff and best practices related with it. So today, what about proper commit messages?

How often did you take a look at the history of some file/folder?? It's just the best backup system you could have and that's one of the main purposes of a VCS (forget about branching, merging etc for a while ). And if you did look at your commit messages, were they meaningful?? Did they make any sense to you?? So often they don't, right? Messages like...
  • method 'SomeMethodInAClass' modified
  • production-build
  • added some files
  • fixed some bugs
  • ...
...they just don't say anything, right?? You have to open some kind of comparison editor and directly look at what actually changed.

Instead...

When looking at the 1st sample comment "method 'SomeMethodInAClass' modified", what would you think about this comment as a (more expressive) alternative:

Bugfix: changed LINQ query to return all entities EXCEPT the current one

Now assume you're currently searching for an issue you're having related to the reading of some entities...I bet this message would jump on your eyes immediately!

So..

..the history excerpt from your VCS should nearly be something that you could directly copy and paste as a public version history on your webpage.


The Java Zone is brought to you in partnership with ZeroTurnaround. Check out this 8-step guide to see how you can increase your productivity by skipping slow application redeploys and by implementing application profiling, as you code!

Topics:

Published at DZone with permission of Juri Strumpflohner, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}