]> git.cworth.org Git - obsolete/notmuch-wiki/blobdiff - patchformatting.mdwn
65 -> 72 character limit helps a bit
[obsolete/notmuch-wiki] / patchformatting.mdwn
index 914371d4da071d916340c945304a26f02e06021c..8a8b37dadb6e0371d3b9b49a4cbb4a6c4d7382ee 100644 (file)
@@ -25,13 +25,40 @@ working tree will follow.
 
 Enter your commit message in following format:
 
-      first commit line; one line description, up to 65 chars
+      first commit line; short one line description
       
       After one empty line, a detailed description of your changes
       the description most usually spans over multiple lines.
 
-The 65-character (limit) seems to be common among many projects so
-that is good guideline to follow here too.
+Wrap the lines to about __72__ characters or so. On an 80 column terminal,
+if we subtract 4 columns for the indent on the left and 4 more for
+symmetry on the right, we’re left with __72__ columns.
+
+Regarding the commit message body contents,
+Carl [has stated](http://article.gmane.org/gmane.mail.notmuch.general/504):
+
+> The single line summary is good about saying *what* the commit does,
+> but I always want to see at least one sentence about the *why* as well.
+
+### Activating default pre-commit hook
+
+Git provides a default pre-commit hook which, when activated, checks
+(at least) for whitespace errors (trailing whitespace and space before
+tab). It is better to notice this kind of "errors" early than have
+patch reviewers to mention about those.
+
+The hook, when activated, is named as .git/hooks/pre-commit and it
+has execute permissions set on. By default, when git tree is cloned
+your hooks dir may have default, inactive pre-commit hook available
+as:
+
+1. .git/hooks/pre-commit  without execute permission set
+
+2. .git/hooks/pre-commit.sample  usually with execute permission set
+
+In case of 2, enter `cp .git/hooks/pre-commit.sample .git/hooks/pre-commit`.
+And, now enter `chmod a+x .git/hooks/pre-commit` in case it does not
+have execute permission set.
 
 ## Remember: one patch per email