aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/contributing_to_ruby_on_rails.textile
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2012-05-20 23:30:37 -0700
committerPiotr Sarnacki <drogus@gmail.com>2012-05-21 00:00:05 -0700
commitae8b09c310989860ed37df072ffa7c6a533bf5ba (patch)
tree0c9cc5c074030bee7fd94fad2a6cc4e89c3de114 /guides/source/contributing_to_ruby_on_rails.textile
parent7c95be54b4c3f8ad2273eea39afa233f8f8b31c1 (diff)
downloadrails-ae8b09c310989860ed37df072ffa7c6a533bf5ba.tar.gz
rails-ae8b09c310989860ed37df072ffa7c6a533bf5ba.tar.bz2
rails-ae8b09c310989860ed37df072ffa7c6a533bf5ba.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 'guides/source/contributing_to_ruby_on_rails.textile')
-rw-r--r--guides/source/contributing_to_ruby_on_rails.textile32
1 files changed, 31 insertions, 1 deletions
diff --git a/guides/source/contributing_to_ruby_on_rails.textile b/guides/source/contributing_to_ruby_on_rails.textile
index df475a2359..a2254a550c 100644
--- a/guides/source/contributing_to_ruby_on_rails.textile
+++ b/guides/source/contributing_to_ruby_on_rails.textile
@@ -343,9 +343,39 @@ 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