You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: railties/guides/source/contributing_to_ruby_on_rails.textile
+33-1Lines changed: 33 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -329,9 +329,41 @@ h4. Commit Your Changes
329
329
When you're happy with the code on your computer, you need to commit the changes to git:
330
330
331
331
<shell>
332
-
$ git commit -a -m "Here is a commit message on what I changed in this commit"
332
+
$ git commit -a
333
333
</shell>
334
334
335
+
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.
336
+
337
+
Good commit message should be formatted according to the following example:
338
+
339
+
<plain>
340
+
Short summary (ideally 50 characters or less)
341
+
342
+
More detailed description, if necessary. It should be wrapped to 72
343
+
characters. Try to be as descriptive as you can, even if you think that
344
+
the commit content is obvious, it may not be obvious to others. You
345
+
should add such description also if it's already present in bug tracker,
346
+
it should not be necessary to visit a webpage to check the history.
347
+
348
+
Description can have multiple paragraps and you can use code examples
349
+
inside, just indent it with 4 spaces:
350
+
351
+
class PostsController
352
+
def index
353
+
respond_with Post.limit(10)
354
+
end
355
+
end
356
+
357
+
You can also add bullet points:
358
+
359
+
- you can use dashes or asterisks
360
+
361
+
- also, try to indent next line of a point for readability, if it's too
362
+
long to fit in 72 characters
363
+
</plain>
364
+
365
+
TIP. Please squash your commits into a single commit when appropriate. This simplifies future cherry picks, and also keeps the git log clean.
366
+
335
367
h4. Update master
336
368
337
369
It’s pretty likely that other changes to master have happened while you were working. Go get them:
0 commit comments