aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2012-05-21 00:07:34 -0700
committerPiotr Sarnacki <drogus@gmail.com>2012-05-21 00:07:34 -0700
commit64e12ff109ad934939df317e532647c603f90520 (patch)
tree7be183a7d7cb297e6fea9298daddbff205406a9c /railties
parentb0f8355d2813c375bf9242071131e8c5a350bcf0 (diff)
downloadrails-64e12ff109ad934939df317e532647c603f90520.tar.gz
rails-64e12ff109ad934939df317e532647c603f90520.tar.bz2
rails-64e12ff109ad934939df317e532647c603f90520.zip
More info on commit messages in contributing guide
Add more info on how to write a good commit messages along with example showing nicely formatted commit message. Rails git history does not look too well when you try to figure out why particular changes were introduced. We can do much better than that and it's never too late to start.
Diffstat (limited to 'railties')
-rw-r--r--railties/guides/source/contributing_to_ruby_on_rails.textile34
1 files changed, 33 insertions, 1 deletions
diff --git a/railties/guides/source/contributing_to_ruby_on_rails.textile b/railties/guides/source/contributing_to_ruby_on_rails.textile
index c54c5be63a..f1f6c8f21b 100644
--- a/railties/guides/source/contributing_to_ruby_on_rails.textile
+++ b/railties/guides/source/contributing_to_ruby_on_rails.textile
@@ -329,9 +329,41 @@ h4. Commit Your Changes
When you're happy with the code on your computer, you need to commit the changes to git:
<shell>
-$ git commit -a -m "Here is a commit message on what I changed in this commit"
+$ git commit -a
</shell>
+At this point, your editor should be fired up and you can write a message for this commit. Well formatted and descriptive commit messages are extremely helpful for the others, especially when figuring out why given change was made, so please take the time to write it.
+
+Good commit message should be formatted according to the following example:
+
+<plain>
+Short summary (ideally 50 characters or less)
+
+More detailed description, if necessary. It should be wrapped to 72
+characters. Try to be as descriptive as you can, even if you think that
+the commit content is obvious, it may not be obvious to others. You
+should add such description also if it's already present in bug tracker,
+it should not be necessary to visit a webpage to check the history.
+
+Description can have multiple paragraps and you can use code examples
+inside, just indent it with 4 spaces:
+
+ class PostsController
+ def index
+ respond_with Post.limit(10)
+ end
+ end
+
+You can also add bullet points:
+
+- you can use dashes or asterisks
+
+- also, try to indent next line of a point for readability, if it's too
+ long to fit in 72 characters
+</plain>
+
+TIP. Please squash your commits into a single commit when appropriate. This simplifies future cherry picks, and also keeps the git log clean.
+
h4. Update master
It’s pretty likely that other changes to master have happened while you were working. Go get them: