Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Repository Commit Msg Etiquette

Tags:

commit

svn

I've never had the chance to work with a team on a repo, so I'm wondering if there is a proper way to document your changes.

For example, maybe add a tag(s) such as: bugfix, update, implement? Just curious on how professionals describe their commits.

Hopefully it'll aid me in keeping the project organized...

like image 372
sap Avatar asked Mar 10 '10 13:03

sap


2 Answers

It should be a clear, concise description of what was changed or implemented in that commit. If you've integrated with an issue tracking system, the issue number is also useful.

The bottom line is, the message should make sense to a) other people, so that they understand what was done without looking at the code, and b) yourself, when you look at the log a year later trying to find where you fixed the bug with the foobar.

Example of a good message:

Fixed the bug where the program would crash if the number of entries was zero
(issue #2857)

Example of a bad message:

Fixed email bug
like image 124
Michael Hackner Avatar answered Oct 10 '22 02:10

Michael Hackner


Commit comments should contains a brief description of what you did and why you did it, without details on the how: if someone needs this kind of details, he can look the diffs. Don't fill the comments with redundant implementation details.

like image 24
Davide Gualano Avatar answered Oct 10 '22 00:10

Davide Gualano