Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are check-in/commit comments a required field in some source control systems?

In Perforce (atleast the GUI) a check-in/commit comment is required. (I don't believe they are required in Git or Subversion.) Most developers that work with me just fill it in with latest/updated/etc. I used to write meaningful descriptions, but at about 20 comments a day with stuff like 'replace an image.' 'Changed spelling of 'franhcise' gets really annoying. Furthermore most changes can be quickly seen in a Diff.

At first I thought I was just being lazy, but I tend not to even look at them when reviewing other peoples code. I'd rather go right to the Diff. Am I alone? Are required comments a good idea?

like image 678
Shawn Avatar asked Nov 28 '22 16:11

Shawn


1 Answers

You should always leave good comments. Not necessarily describing what you changed, unless it is a large changeset with too many distracting little details... but always, always, describe why you made the change (maybe link to a bug tracker item if there is one).

When i'm looking at your diff a year later, after realizing that it introduced a subtle bug, i need to know why the change was made - if i can't find a good reason, i'm just going to roll it back and curse your lazy ways... ;-)

like image 57
Shog9 Avatar answered Dec 04 '22 06:12

Shog9