From: Rusty Russell <rusty@rustcorp.com.au>
To: Jonathan Corbet <corbet@lwn.net>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Dave Jones <davej@redhat.com>, Theodore Tso <tytso@mit.edu>
Subject: Re: Fix quilt merge error in acpi-cpufreq.c
Date: Mon, 20 Apr 2009 17:44:21 +0930 [thread overview]
Message-ID: <200904201744.22572.rusty@rustcorp.com.au> (raw)
In-Reply-To: <20090416075541.527b8f85@bike.lwn.net>
On Thu, 16 Apr 2009 11:25:41 pm Jonathan Corbet wrote:
> On Thu, 16 Apr 2009 11:30:26 +0930
> Rusty Russell <rusty@rustcorp.com.au> wrote:
>
> > Anyone want to try to write a guide on writing good commit messages?
>
> I've tried to do that about halfway through
> Documentation/development-process/5.Posting. No doubt it can be
> improved...patches (with good commit messages) welcome :)
I think Ted put his finger on it: the definition of a good commit
message is one which is kind to the reader.
There are several readers: someone reviewing the patch, someone looking
for a specific bug, someone backporting, someone dealing with an API change,
someone bisecting. A reviewer needs to know why the patch is done the way it
is, the bughunter needs to be able to find the commit from the bug symptoms,
the backporter needs to know what the patch fixes, how severe it is, and what
side effects are expected, the what-happened reader needs to know how to port
to the new API (and probably why it changed), and the bisector doesn't need
much at all (since the patch is buggy, the commentry is probably wrong anyway,
but perhaps they need to judge what reverting the patch will do).
Here are my thoughts:
- Actual demonstrated fixes for demonstrated bugs should aim for subject
"<subsystem>: fix <symptom> <condition>...", eg: "modules: fix crash when out
of memory" or "modules: fix compile error on arm" or "modules: fix module
load when CONFIG_FOO=y, CONFIG_BAR=n, moon=full".
Body should include:
- how likely (if not obvious from subject).
- how important. Root can crash box maybe isn't important, but if
NetworkManager default configuration tickles the bug, it might be.
- text of message which results if any. Oops (trimmed), compile error,
unexpected output of utility.
- when the bug was introduced (or exposed).
- upstream (bugzilla, ml message, or at least reporter) so it can be dug
further if required.
I suggest that the keyword "fix" not be used for theoretical or soon-to-be-
exposed limitations of code. eg. "virtio: correction to BAD_RING
macro if arg is not called 'vq'" not "virtio: fix BAD_RING macro when..."
(this was a real example, but the arg was always called 'vq').
- Neatening-and-documenting commits should aim for "<subsystem>: cleanup...",
eg. "lguest: cleanup typos in headers" or "lguest: cleanup: rename internal
function", or "module: cleanup: move function out of header".
Body should include:
- larger plan if there is one (eg. removing obsolete function, reordering
functions because we're going to do something later, exposing functions
because we're going to need them in successive patch).
- No subject should ever contain the word "trivial". If it's really trivial,
you can sum it up in the subject and we'll know it's trivial. Plus the
diffstat shows it. 'trivial' is propaganda to sneak a patch into -rc7.
- API changes or deprecation should say why the change is happening, and
how to port. The subject line should say what's changed in preference
to why. eg. "per_cpu: deprecate per_cpu_ptr in favor of percpu_ptr", or
"list.h: add list_for_each_reverse_rcu_backflip".
- The change message should always be about the change, not the new code.
For example, the above commit might say "we need this for the new backflip.c
debugging code", but the documentation of the function belongs in the code
itself, not the git log!
Writing good commit messages takes time, practice and feedback. But
if you're having trouble writing a good commit message, it's often a sign
that your patch needs to be reworked anyway.
Sorry for the too-long post, but this stuff actually matters...
Rusty.
next prev parent reply other threads:[~2009-04-20 8:14 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200904140159.n3E1x1K1014705@hera.kernel.org>
2009-04-14 2:05 ` Fix quilt merge error in acpi-cpufreq.c Ingo Molnar
2009-04-15 5:44 ` Ingo Molnar
2009-04-15 10:44 ` Rusty Russell
2009-04-15 15:28 ` Linus Torvalds
2009-04-15 16:26 ` Ingo Molnar
2009-04-15 16:46 ` H. Peter Anvin
2009-04-15 17:00 ` H. Peter Anvin
2009-04-15 17:19 ` Linus Torvalds
2009-04-15 18:47 ` H. Peter Anvin
2009-04-15 19:43 ` Linus Torvalds
2009-04-15 20:07 ` Ingo Molnar
2009-04-15 20:32 ` Andrew Morton
2009-04-15 21:03 ` Ingo Molnar
2009-04-15 21:15 ` Linus Torvalds
2009-04-15 22:40 ` Ingo Molnar
2009-04-15 23:08 ` Linus Torvalds
2009-04-16 0:08 ` Ingo Molnar
2009-04-16 0:23 ` Linus Torvalds
2009-04-16 0:38 ` Linus Torvalds
2009-04-16 0:50 ` Ingo Molnar
2009-04-16 4:33 ` H. Peter Anvin
2009-04-16 7:14 ` Ingo Molnar
2009-04-16 15:24 ` Valdis.Kletnieks
2009-04-15 23:49 ` David Miller
2009-04-16 11:00 ` Christoph Hellwig
2009-04-15 21:17 ` Andrew Morton
2009-04-15 23:04 ` Ingo Molnar
2009-04-15 21:23 ` David Miller
2009-04-15 22:48 ` Ingo Molnar
2009-04-15 23:11 ` Linus Torvalds
2009-04-16 0:44 ` Ingo Molnar
2009-04-16 1:03 ` Linus Torvalds
2009-04-16 1:46 ` Ingo Molnar
2009-04-16 2:22 ` Linus Torvalds
2009-04-16 7:23 ` Ingo Molnar
2009-04-16 3:55 ` Theodore Tso
2009-04-16 7:44 ` Ingo Molnar
2009-04-16 15:41 ` Valdis.Kletnieks
2009-04-16 13:04 ` Valdis.Kletnieks
2009-04-16 2:00 ` Rusty Russell
2009-04-16 2:22 ` Paul Gortmaker
2009-04-16 2:34 ` Linus Torvalds
2009-04-16 3:10 ` Ray Lee
2009-04-16 7:56 ` Ingo Molnar
2009-04-16 11:57 ` Theodore Tso
2009-04-16 13:55 ` Jonathan Corbet
2009-04-20 8:14 ` Rusty Russell [this message]
2009-04-20 10:38 ` Ingo Molnar
2009-04-22 4:18 ` Rusty Russell
2009-04-21 19:37 ` Jonathan Corbet
2009-04-22 1:58 ` Rusty Russell
2009-04-16 1:27 ` Rusty Russell
2009-04-16 2:31 ` Theodore Tso
2009-04-16 8:02 ` Ingo Molnar
2009-04-15 15:05 ` Linus Torvalds
2009-04-15 15:22 ` Ali Gholami Rudi
2009-04-15 16:41 ` Ingo Molnar
[not found] <crh66-6nQ-7@gated-at.bofh.it>
[not found] ` <crilu-8hM-13@gated-at.bofh.it>
[not found] ` <crjhu-1lb-13@gated-at.bofh.it>
[not found] ` <crkQl-3QL-7@gated-at.bofh.it>
[not found] ` <crm5K-5NR-17@gated-at.bofh.it>
[not found] ` <crmyK-6DP-9@gated-at.bofh.it>
[not found] ` <crnXV-g5-27@gated-at.bofh.it>
[not found] ` <croh9-VK-5@gated-at.bofh.it>
[not found] ` <croTQ-1Jm-1@gated-at.bofh.it>
[not found] ` <crqVM-4UC-11@gated-at.bofh.it>
2009-04-16 5:46 ` Niel Lambrechts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200904201744.22572.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=davej@redhat.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox