Open main menu

Difference between revisions of "Commit Guidelines"

317 bytes removed ,  12:17, 12 February 2006
Removed some unnecessary explanations, some cleanup
m
(Removed some unnecessary explanations, some cleanup)
Line 2: Line 2:


The following is an excerpt from the FreeBSD Committer's Guide <http://www.freebsd.org/doc/en_US.ISO8859-1/articles/committers-guide/article.html> and sums up quite nicely what I think:
The following is an excerpt from the FreeBSD Committer's Guide <http://www.freebsd.org/doc/en_US.ISO8859-1/articles/committers-guide/article.html> and sums up quite nicely what I think:


== Excerpt from the FreeBSD Committer's Guide ==
== Excerpt from the FreeBSD Committer's Guide ==
Good commit messages are important. They tell others why you did the changes you did, not just right here and now, but months or years from now when someone wonders why some seemingly illogical or inefficient piece of code snuck into your source file. It is also an invaluable aid to deciding which changes to MFC and which not to MFC.
Good commit messages are important. They tell others why you did the changes you did, not just right here and now, but months or years from now when someone wonders why some seemingly illogical or inefficient piece of code snuck into your source file. It is also an invaluable aid to deciding which changes to MFC and which not to MFC.


Commit messages should be clear, concise and provide a reasonable summary to give an indication of what was changed and why.
* Commit messages should be clear, concise and provide a reasonable summary to give an indication of what was changed and why.
 
* Commit messages should provide enough information to enable a third party to decide if the change is relevant to them and if they need to read the change itself.
Commit messages should provide enough information to enable a third party to decide if the change is relevant to them and if they need to read the change itself.
* Avoid committing several unrelated changes in one go. It makes merging difficult, and also makes it harder to determine which change is the culprit if a bug crops up.
 
* Avoid committing style or whitespace fixes and functionality fixes in one go. It makes merging difficult, and also makes it harder to understand just what functional changes were made. In the case of documentation files, it can make the job of the translation teams more complicated, as it becomes difficult for them to determine exactly what content changes need to be translated.
Avoid committing several unrelated changes in one go. It makes merging difficult, and also makes it harder to determine which change is the culprit if a bug crops up.
* Avoid committing changes to multiple files in one go with a generic, vague message. Instead, commit each file (or small, related groups of files) with tailored commit messages.
 
Avoid committing style or whitespace fixes and functionality fixes in one go. It makes merging difficult, and also makes it harder to understand just what functional changes were made. In the case of documentation files, it can make the job of the translation teams more complicated, as it becomes difficult for them to determine exactly what content changes need to be translated.
 
Avoid committing changes to multiple files in one go with a generic, vague message. Instead, commit each file (or small, related groups of files) with tailored commit messages.




== Examples ==
== Examples ==
I'll give some examples. Please understand that I do not mean this personal, so if you see yours listed here -- I don't want this to tarnish your reputation, I think none of us is "free of sin" here :-). I included messages from me, too.
Commit messages like the following aren't very helpful:
 
 
Examples: Commit messages like the following aren't very helpful:
* "not needed"  --> uhm, what is not needed?
* "not needed"  --> uhm, what is not needed?
* "bye bye" --> was some obsolete code removed? Or did somebody leave the project? Or what?
* "bye bye" --> was some obsolete code removed? Or did somebody leave the project? Or what?
Line 38: Line 32:
* "Add patch #1374870 - New Lure of the Temptress module"
* "Add patch #1374870 - New Lure of the Temptress module"


Don't be too verbose in your message either. You don't have to tell people what the next step in the grand scheme are in a long paragraph (hi Erik, I do enjoy your commit messages greatly, don't get me wrong :-).
Don't be too verbose in your message either. You don't have to tell people what the next step in the grand scheme are in a long paragraph.
1,079

edits