]> code.delx.au - gnu-emacs/blob - CONTRIBUTE
CONTRIBUTE: Mention log-edit-insert-changelog
[gnu-emacs] / CONTRIBUTE
1 This file contains information on Emacs developer processes.
2
3 For information on contributing to Emacs as a non-developer, see
4 (info "(emacs)Contributing") or
5 http://www.gnu.org/software/emacs/manual/html_node/emacs/Contributing.html
6
7 * Information for Emacs Developers.
8
9 An "Emacs Developer" is someone who contributes a lot of code or
10 documentation to the Emacs repository. Generally, they have write
11 access to the Emacs git repository on Savannah
12 https://savannah.gnu.org/git/?group=emacs.
13
14 ** Write access to the Emacs repository.
15
16 Once you become a frequent contributor to Emacs, we can consider
17 giving you write access to the version-control repository. Request
18 access on the emacs-devel@gnu.org mailing list.
19
20 ** Using the Emacs repository
21
22 Emacs uses git for the source code repository.
23
24 See http://www.emacswiki.org/emacs/GitQuickStartForEmacsDevs to get
25 started, and http://www.emacswiki.org/emacs/GitForEmacsDevs for more
26 advanced information.
27
28 Alternately, see admin/notes/git-workflow.
29
30 If committing changes written by someone else, make the ChangeLog
31 entry in their name, not yours. git distinguishes between the author
32 and the committer; use the --author option on the commit command to
33 specify the actual author; the committer defaults to you.
34
35 ** Commit messages
36
37 Typically, a patch creates ChangeLog entries by putting them into its
38 commit message, not by changing a ChangeLog file. Here is an example
39 commit message (indented):
40
41 Deactivate shifted region
42
43 Do not silently extend a region that is not highlighted;
44 this can happen after a shift.
45 * doc/emacs/mark.texi (Shift Selection): Document the change.
46 * lisp/window.el (handle-select-window):
47 * src/frame.c (Fhandle_switch_frame, Fselected_frame):
48 Deactivate the mark.
49 Fixes: bug#19003
50
51 The general format is as follows.
52
53 - Start with a single unindented summary line explaining the change,
54 then an empty line, then unindented ChangeLog entries.
55
56 - Limit lines in commit messages to 78 characters, unless they consist
57 of a single word of at most 140 characters; this is enforced by a
58 commit hook. It's nicer to limit the summary line to 50 characters;
59 this isn't enforced. If the change can't be summarized so briefly,
60 add a paragraph after the empty line and before the individual file
61 descriptions.
62
63 - If only a single file is changed, the summary line can be the normal
64 file first line (starting with the asterisk). Then there is no
65 individual files section.
66
67 - Explaining the rationale for a design choice is best done in comments
68 in the source code. However, sometimes it is useful to describe just
69 the rationale for a change; that can be done in the commit message
70 between the summary line and the file entries.
71
72 - Commit messages should contain only printable UTF-8 characters.
73
74 - Commit messages should not contain the "Signed-off-by:" lines that
75 are used in some other projects.
76
77 - Emacs generally follows the GNU coding standards when it comes to
78 ChangeLogs:
79 http://www.gnu.org/prep/standards/html_node/Change-Logs.html . One
80 exception is that we still sometimes quote `like-this' (as the
81 standards used to recommend) rather than 'like-this' (as they do
82 now), because `...' is so widely used elsewhere in Emacs.
83
84 - Some of the rules in the GNU coding standards section 5.2
85 "Commenting Your Work" also apply to ChangeLog entries: they must be
86 in English, and be complete sentences starting with a capital and
87 ending with a period (except the summary line should not end in a
88 period).
89
90 It is tempting to relax this rule for commit messages, since they
91 are somewhat transient. However, they are preserved indefinitely,
92 and have a reasonable chance of being read in the future, so it's
93 better that they have good presentation.
94
95 - Use the present tense; describe "what the change does", not "what
96 the change did".
97
98 - Preferred form for several entries with the same content:
99
100 * lisp/help.el (view-lossage):
101 * lisp/kmacro.el (kmacro-edit-lossage):
102 * lisp/edmacro.el (edit-kbd-macro): Fix docstring, lossage is now 300.
103
104 (Rather than anything involving "ditto" and suchlike.)
105
106 - If the commit has authors other than yourself, the commit message
107 should contain a separate line like the following:
108
109 Co-authored-by: Joe Schmoe <j.schmoe@example.org>
110
111 - If the commit is a tiny change that is exempt from copyright paperwork,
112 the commit message should contain a separate line like the following:
113
114 Copyright-paperwork-exempt: yes
115
116 - If the commit fixes a bug, append a separate line
117
118 Fixes: bug#NNNN
119
120 where NNNN is the bug number.
121
122 - In ChangeLog entries, there is no standard or recommended way to
123 identify revisions.
124
125 One way to identify revisions is by quoting their summary line.
126 Another is with an action stamp - an RFC3339 date followed by !
127 followed by the committer's email - for example,
128 "2014-01-16T05:43:35Z!esr@thyrsus.com". Often, "my previous commit"
129 will suffice.
130
131 - There is no need to make separate ChangeLog entries for files such
132 as NEWS, MAINTAINERS, and FOR-RELEASE, or to indicate regeneration
133 of files such as 'configure'. "There is no need" means you don't
134 have to, but you can if you want to.
135
136 - If a commit message's first line starts with "; ", the message is
137 ignored when generating ChangeLog history files via 'make changelog'
138 or via 'make change-history'. You can use "; " for minor commits
139 that do not need separate ChangeLog entries.
140
141 ** Generating ChangeLog entries
142
143 - You can use various Emacs functions to ease the process of writing
144 ChangeLog entries; see (info "(emacs)Change Log Commands") or
145 http://www.gnu.org/software/emacs/manual/html_node/emacs/Change-Log-Commands.html.
146
147 - If you use Emacs VC, one way to format ChangeLog entries is to create
148 a top-level ChangeLog file manually, and update it with 'C-x 4 a' as
149 usual. Do not register the ChangeLog file under git; instead, use
150 'C-c C-a' to insert its contents into into your *vc-log* buffer.
151 Or if `log-edit-hook' includes `log-edit-insert-changelog' (which it
152 does by default), they will be filled in for you automatically.
153
154 - Alternatively, you can use the vc-dwim command to maintain commit
155 messages. When you create a source directory, run the shell command
156 'git-changelog-symlink-init' to create a symbolic link from
157 ChangeLog to .git/c/ChangeLog. Edit this ChangeLog via its symlink
158 with Emacs commands like 'C-x 4 a', and commit the change using the
159 shell command 'vc-dwim --commit'. Type 'vc-dwim --help' for more.
160
161 ** branches
162
163 Development normally takes places on the trunk.
164 Sometimes specialized features are developed on separate branches
165 before possibly being merged to the trunk.
166
167 Development is discussed on the emacs-devel mailing list.
168
169 Sometime before the release of a new major version of Emacs a "feature
170 freeze" is imposed on the trunk, to prepare for creating a release
171 branch. No new features may be added to the trunk after this point,
172 until the release branch is created. Announcements about the freeze
173 (and other important events) are made on the info-gnu-emacs mailing
174 list, and not anywhere else.
175
176 The trunk branch is named "master" in git; release branches are named
177 "emacs-nn" where "nn" is the major version.
178
179 If you are fixing a bug that exists in the current release, be sure to
180 commit it to the release branch; it will be merged to the master
181 branch later.
182
183 However, if you know that the change will be difficult to merge to the
184 trunk (eg because the trunk code has changed a lot), you can apply the
185 change to both trunk and branch yourself. Indicate in the release
186 branch commit log that there is no need to merge the commit to the
187 trunk; start the commit message with "Backport:". gitmerge.el will
188 then exclude that commit from the merge to trunk.
189
190
191 ** Other process information
192
193 See all the files in admin/notes/* . In particular, see
194 admin/notes/newfile, see admin/notes/repo.
195
196 *** git vs rename
197
198 git does not explicitly represent a file renaming; it uses a percent
199 changed heuristic to deduce that a file was renamed. So if you are
200 planning to make extensive changes to a file after renaming it (or
201 moving it to another directory), you should:
202
203 - create a feature branch
204
205 - commit the rename without any changes
206
207 - make other changes
208
209 - merge the feature branch to trunk, _not_ squashing the commits into
210 one. The commit message on this merge should summarize the renames
211 and all the changes.
212
213 ** Emacs Mailing lists.
214
215 Discussion about Emacs development takes place on emacs-devel@gnu.org.
216
217 Bug reports and fixes, feature requests and implementations should be
218 sent to bug-gnu-emacs@gnu.org, the bug/feature list. This is coupled
219 to the tracker at http://debbugs.gnu.org .
220
221 You can subscribe to the mailing lists, or see the list archives,
222 by following links from http://savannah.gnu.org/mail/?group=emacs .
223
224 To email a patch you can use a shell command like 'git format-patch -1'
225 to create a file, and then attach the file to your email. This nicely
226 packages the patch's commit message and changes.
227
228 ** Document your changes.
229
230 Any change that matters to end-users should have an entry in etc/NEWS.
231
232 Doc-strings should be updated together with the code.
233
234 Think about whether your change requires updating the manuals. If you
235 know it does not, mark the NEWS entry with "---". If you know
236 that *all* the necessary documentation updates have been made, mark
237 the entry with "+++". Otherwise do not mark it.
238
239 Please see (info "(elisp)Documentation Tips") or
240 https://www.gnu.org/software/emacs/manual/html_node/elisp/Documentation-Tips.html
241 for more specific tips on Emacs's doc style. Use `checkdoc' to check
242 for documentation errors before submitting a patch.
243
244 ** Test your changes.
245
246 Please test your changes before committing them or sending them to the
247 list.
248
249 Emacs uses ERT, Emacs Lisp Regression Testing, for testing. See (info
250 "(ert)") or https://www.gnu.org/software/emacs/manual/html_node/ert/
251 for more information on writing and running tests.
252
253 To run tests on the entire Emacs tree, run "make check" from the
254 top-level directory. Most tests are in the directory
255 "test/automated". From the "test/automated" directory, run "make
256 <filename>" to run the tests for <filename>.el(c). See
257 "test/automated/Makefile" for more information.
258
259 ** Understanding Emacs Internals.
260
261 The best way to understand Emacs Internals is to read the code,
262 but the nodes "Tips" and "GNU Emacs Internals" in the Appendix
263 of the Emacs Lisp Reference Manual may also help.
264
265 The file etc/DEBUG describes how to debug Emacs bugs.
266
267
268 \f
269 This file is part of GNU Emacs.
270
271 GNU Emacs is free software: you can redistribute it and/or modify
272 it under the terms of the GNU General Public License as published by
273 the Free Software Foundation, either version 3 of the License, or
274 (at your option) any later version.
275
276 GNU Emacs is distributed in the hope that it will be useful,
277 but WITHOUT ANY WARRANTY; without even the implied warranty of
278 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
279 GNU General Public License for more details.
280
281 You should have received a copy of the GNU General Public License
282 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
283 \f
284 Local variables:
285 mode: outline
286 paragraph-separate: "[ \f]*$"
287 end: