Gentoo Archives: gentoo-dev

From: Ciaran McCreesh <ciaranm@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Proper commit messages
Date: Mon, 08 Aug 2005 20:49:03
Message-Id: 20050808214450.2bcc6a34@snowdrop.home
1 Well, you'd think that doing main tree CVS commit messages would be
2 something that everyone could do properly without being told, but sadly
3 this doesn't seem to be the case. Soooo...
4
5 Believe it or not, commit messages are not just something that you type
6 in to keep a computer happy. These messages are also read by QA and arch
7 people.
8
9 If you're not a QA or arch person, and you don't consider spending a few
10 moments to make life easier for those people to be sufficient reason,
11 you might want to consider that repeated ``cvs diff`` runs will hit the
12 CVS server far more than one ``cvs log``.
13
14 If you're the sort that writes good ChangeLog messages anyway, there's
15 nothing wrong with reusing them as the commit message. If you have a
16 really really good reason for not using a ChangeLog message, or if you
17 haven't yet written a shell alias for reusing ChangeLog messages for
18 commits, you still need to come up with something for the commit
19 message.
20
21 Your commit message should explain what specifically you changed and, if
22 relevant, why. You don't need to write an essay or even a complete
23 sentence (ChangeLog messages, however, *are* required to be in 'proper'
24 English), so long as it is easily understandable and (preferably)
25 greppable. Examples, all of which are based upon real messages:
26
27 BAD: Changed keywords
28 GOOD: Added ~x86 keyword
29
30 BAD: Stable
31 GOOD: Stable on x86, sparc, mips
32
33 BAD: Fix stuff
34 GOOD: Fix USE=foo logic error
35
36 BAD: .
37 GOOD: Purge old ebuilds
38
39 BAD: Vérifiez que le frozbinateur n'est pas cassé.
40 GOOD: Added a check for broken frozbinator.
41
42 BAD: Who the fuck reads these anyway?
43 GOOD: Version bump.
44
45 Whilst I'm at it, I might as well comment on some things that are useful
46 in ChangeLogs that don't always get done properly:
47
48 * Any relevant bug numbers, formatted like "bug #20600". The # is
49 important, it's used by various things (eg packages.g.o) that
50 automagically add links to text.
51
52 * What that patch you're adding actually does.
53
54 * The archs you're working with when keywording. "Marked stable" is a
55 nuisance for arch people, even if there was only one keyword in the
56 ebuild at the time. "Stable on all archs" isn't generally any better
57 (and should you really be stabling on all archs?) -- do you mean
58 "all", or "all the ones that are currently keyworded"? A list like
59 "x86 sparc mips" is much more useful.
60
61 This rant was not inspired by someone committing a bunch of things with
62 one character (and a punctuation character at that) commit messages
63 despite repeatedly having been asked not to. Honest.
64
65 --
66 Ciaran McCreesh : Gentoo Developer (Vim, Shell tools, Fluxbox, Cron)
67 Mail : ciaranm at gentoo.org
68 Web : http://dev.gentoo.org/~ciaranm

Replies

Subject Author
Re: [gentoo-dev] Proper commit messages Markus Rothe <corsair@g.o>