Gentoo Archives: gentoo-dev

From: gokturk@××××××××××.edu
To: devmanual@g.o
Cc: gentoo-dev@l.g.o, Gokturk Yuksek <gokturk@××××××××××.edu>
Subject: [gentoo-dev] [PATCH v3 20/21] ebuid-maintenance: add a new section called "Git Commit Message Format" #558642
Date: Thu, 04 Feb 2016 01:04:34
Message-Id: 1454547469-22487-21-git-send-email-gokturk@binghamton.edu
In Reply to: [gentoo-dev] [PATCH v3 00/21] devmanual: update the docs for post git-migration by gokturk@binghamton.edu
1 From: Gokturk Yuksek <gokturk@××××××××××.edu>
2
3 This section includes the content from the "Commit message format"
4 subsection on Gentoo git workflow wiki page, combines it with some of
5 the information that was part of the old ChangeLog section in
6 devmanual and expands on those based on the feedback from the developers
7 on the gentoo-dev@g.o mailing list.
8
9 Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=558642
10 Reviewed-by: NP-Hardass <np-hardass@g.o>
11 Signed-off-by: Gokturk Yuksek <gokturk@××××××××××.edu>
12 ---
13 ebuild-maintenance/text.xml | 113 ++++++++++++++++++++++++++++++++++++++++++++
14 1 file changed, 113 insertions(+)
15
16 diff --git a/ebuild-maintenance/text.xml b/ebuild-maintenance/text.xml
17 index 26cca2f..5b2abee 100644
18 --- a/ebuild-maintenance/text.xml
19 +++ b/ebuild-maintenance/text.xml
20 @@ -96,6 +96,119 @@ work on those architectures.
21 </subsection>
22
23 <subsection>
24 +<title>Git Commit Message Format</title>
25 +<body>
26 +
27 +<p>
28 +It is important to format the commit messages properly so that they
29 +communicate the changes to the reader in a clear and concise
30 +way. Additionally, consistency in message format allows for easier
31 +parsing by external tools. The first line of the commit message should
32 +contain a brief summary of the changes, followed by an empty new
33 +line. From the third line onward should be a detailed, multiline
34 +explanation of the changes introduced by the commit. At the very end,
35 +auxiliary information such as the bugs related to the commit,
36 +contributors, and reviewers should be listed using RFC822/git style
37 +tags. The length of the lines in the message should be 70-75
38 +characters at maximum.
39 +</p>
40 +
41 +<p>
42 +The summary line should start with referencing what is affected by the
43 +change followed by a colon ':' character. Use the rules in the
44 +following list to determine the proper format based on what has
45 +changed, substituting the package, category and eclass names
46 +appropriately:
47 +
48 +<ul>
49 +<li><c>${CATEGORY}/${PN}:</c>Single Package (Note that <c>repoman commit</c>
50 +automatically inserts this for you)</li>
51 +<li><c>${CATEGORY}:</c> Package Category</li>
52 +<li><c>profiles:</c> Profile Directory</li>
53 +<li><c>${ECLASS}.eclass:</c> Eclass Directotry</li>
54 +<li><c>licenses:</c> Licenses Directory</li>
55 +<li><c>metadata:</c> Metadata Directory</li>
56 +</ul>
57 +
58 +For packages where <c>${CATEGORY}/${PN}:</c> is long, the line length
59 +limit can be exceeded, if absolutely necessary, to ensure a more
60 +useful summary line. If a commit affects multiple directories, prepend
61 +the message with which reflects the intention of the change best. If
62 +there are any bugs on Gentoo Bugzilla associated with the commit, id
63 +of the bug can be appended to the summary line using the format
64 +<c>#BUG-ID</c>. If you are modifying keywords, clearly state what
65 +keywords are added/removed.
66 +
67 +<warning>
68 +By default, lines starting with <c>#</c> are considered to be comments
69 +by git and not included in the commit message. Make sure that a new
70 +line does not start with <c>#BUG-ID</c>. Optionally, git can be
71 +configured to use a different character for comments by changing the
72 +<c>commentchar</c> option.
73 +</warning>
74 +</p>
75 +
76 +<p>
77 +For non-trivial commits, the message should contain a detailed
78 +explanation of what the commit intends to change, why it is required,
79 +and how it is accomplished, along with any other supplementary
80 +information.
81 +</p>
82 +
83 +<p>
84 +Finally the commit message should list auxiliary information such as
85 +people who are involved in authoring, suggesting, reviewing and
86 +testing the changes, and revelant bugs. Use RFC822/git style tags as
87 +explained in the
88 +<uri link="https://www.kernel.org/doc/Documentation/SubmittingPatches">
89 +Linux Kernel patch guideline</uri>. Additionally, the following tags
90 +are used in Gentoo:
91 +
92 +<ul>
93 +<li><c>Gentoo-Bug:</c> Use this to reference bugs in Gentoo Bugzilla
94 +by either the bug ID or the bugzilla URI. Multiple bugs can be
95 +referenced by inserting more tags of this type or separating bug IDs
96 +with a comma in the same tag. The bug IDs may include an optional '#'
97 +prefix. There is no consensus on referencing bugs in the summary line
98 +versus referencing with a tag in the message body. The developer has
99 +the option to choose either.
100 +</li>
101 +<li><c>Package-Manager:</c> This is automatically inserted by
102 +<c>repoman commit</c> and it specifies the version of
103 +<pkg>sys-apps/portage</pkg> on the system.</li>
104 +<li><c>RepoMan-Options:</c> This is automatically inserted by
105 +<c>repoman commit</c> and records the options passed to repoman (such
106 +as --force) for the commit.</li>
107 +</ul>
108 +</p>
109 +
110 +<p>
111 +When committing <uri link="::ebuild-writing/user-submitted">user
112 +contributions</uri>, make sure to credit them in your commit message
113 +with the user's full name and email address. Be aware and respectful
114 +of their privacy: some users prefer to be only known by a
115 +nickname. Take advantage of the tags such as <c>Suggested-By</c> or
116 +<c>Reported-By:</c>when entering such information to the commit
117 +message.
118 +</p>
119 +
120 +<p>
121 +An example commit message is shown below:
122 +</p>
123 +
124 +<pre caption="Example commit message">
125 +app-misc/foo: version bump to 0.5
126 +
127 +This also adds a new USE flag 'bar' which controls the
128 +new bar functionality introduced with this version.
129 +
130 +Gentoo-Bug: 01234
131 +</pre>
132 +
133 +</body>
134 +</subsection>
135 +
136 +<subsection>
137 <title>Git Commit Policy</title>
138 <body>
139
140 --
141 2.4.10

Replies