Why do some version control systems require registration / fixing comments?

Perforce (at least the GUI) requires a registration / commit request. (I do not believe that they are required in Git or Subversion.) Most of the developers who work with me just populate it with the latest / updated / etc. I used to write meaningful descriptions, but about 20 comments a day with things like “replace image”. “The rewritten spelling of“ franhcise ”becomes very annoying. In addition, most of the changes can be quickly seen in Diff.

At first, I thought I was just lazy, but I tend to not even look at them when viewing other people's code. I would rather go straight to Diff. I'm alone? Looking for comments is a good idea?
+4
source share
7 answers

You should always leave good comments. Not necessarily describing what you changed, unless it is a large set of changes with too many distracting small details ... but always, always , tell us why you made the changes (perhaps a link to the error tracking element, if there is one).

When I look at your diff a year later, realizing that he presented a subtle mistake, I need to know why the change was made - if I can’t find a good reason, I'm just going to throw it back and curse my lazy paths ...; -)

+10
source

Significant comments serve several purposes:

  • If you are looking for a specific change in version history, they allow you to quickly view the history of files (for example: "Hi, I know that we fixed a bug about this widget flickering sometime in March last year. Remember what it was fixed for?" )

  • They encourage you to commit atomized commits. If you end up doing checks with general comments, it probably means that you do too many things at once.

  • As mentioned earlier, they tell you why things are changing. Of course, diff can tell you, for example, about how tax calculations have changed for such an item. But he will not tell you that this happened because the XYZ law for taxation has changed.

  • They make it easy to record release notes or equivalent documentation.

+7
source

Perhaps a slightly different perspective:

If you want to see ALL changes for the year or since the last version - do you want to see all the differences, or do you want to see a good comment of the commit and a link to the defect / problem element?

+6
source

If you make 20 checks a day, you are probably checking too often. Group all minor typos in one session with the comment "fixed various typos."

+2
source

Writing a meaningful comment takes about 30 seconds, so just flip it over and do it.

+2
source

As already discussed in the comments on the Shog9 answer , enforcing a comment at the tool level does not necessarily help to keep lazy people in line, as this requirement is too easy to get around (as mentioned in the question: just enter “last” / “updated” / etc or even "sfakjs; d", which is probably more harmful than an empty string).

However, the fact that the tool requires this can serve as a reminder for a usually conscientious developer who accidentally intends to commit without any explanation. If he does this even once, then we are on the plus side (i.e. the requirement is useful), because usually the functionality does not matter - good guys write comments anyway, while bad gals can always get around regardless of technical barriers that you created. (If you want to keep them at work, this, of course, is another matter.)

+2
source

Mainly because they are not intended to commit after changing the css attribute, etc., but rather after a more significant change / correction. But the comments are very helpful.

-1
source

All Articles