Skip to content

Commit d0f7dcb

Browse files
committed
SubmittingPatches: clarify the expected commit log description
Earlier, 47afed5 (SubmittingPatches: itemize and reflect upon well written changes, 2009-04-28) added a discussion on the contents of the commit log message, but the last part of the new paragraph didn't make much sense. Reword it slightly to make it more readable. Update the "quicklist" to clarify what we mean by "motivation" and "contrast". Also mildly discourage external references. Signed-off-by: Junio C Hamano <[email protected]>
1 parent e0adb84 commit d0f7dcb

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

Documentation/SubmittingPatches

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,18 @@ Checklist (and a short version for the impatient):
1010
description (50 characters is the soft limit, see DISCUSSION
1111
in git-commit(1)), and should skip the full stop
1212
- the body should provide a meaningful commit message, which:
13-
- uses the imperative, present tense: "change",
14-
not "changed" or "changes".
15-
- includes motivation for the change, and contrasts
16-
its implementation with previous behaviour
13+
. explains the problem the change tries to solve, iow, what
14+
is wrong with the current code without the change.
15+
. justifies the way the change solves the problem, iow, why
16+
the result with the change is better.
17+
. alternate solutions considered but discarded, if any.
18+
- describe changes in imperative mood, e.g. "make xyzzy do frotz"
19+
instead of "[This patch] makes xyzzy do frotz" or "[I] changed
20+
xyzzy to do frotz", as if you are giving orders to the codebase
21+
to change its behaviour.
22+
- try to make sure your explanation can be understood without
23+
external resources. Instead of giving a URL to a mailing list
24+
archive, summarize the relevant points of the discussion.
1725
- add a "Signed-off-by: Your Name <[email protected]>" line to the
1826
commit message (or just use the option "-s" when committing)
1927
to confirm that you agree to the Developer's Certificate of Origin
@@ -90,7 +98,10 @@ your commit head. Instead, always make a commit with complete
9098
commit message and generate a series of patches from your
9199
repository. It is a good discipline.
92100

93-
Describe the technical detail of the change(s).
101+
Give an explanation for the change(s) that is detailed enough so
102+
that people can judge if it is good thing to do, without reading
103+
the actual patch text to determine how well the code does what
104+
the explanation promises to do.
94105

95106
If your description starts to get too long, that's a sign that you
96107
probably need to split up your commit to finer grained pieces.
@@ -99,9 +110,8 @@ help reviewers check the patch, and future maintainers understand
99110
the code, are the most beautiful patches. Descriptions that summarise
100111
the point in the subject well, and describe the motivation for the
101112
change, the approach taken by the change, and if relevant how this
102-
differs substantially from the prior version, can be found on Usenet
103-
archives back into the late 80's. Consider it like good Netiquette,
104-
but for code.
113+
differs substantially from the prior version, are all good things
114+
to have.
105115

106116
Oh, another thing. I am picky about whitespaces. Make sure your
107117
changes do not trigger errors with the sample pre-commit hook shipped

0 commit comments

Comments
 (0)