]> sjero.net Git - wget/blob - PATCHES
[svn] Beautify...
[wget] / PATCHES
1 * Guidelines for patch submissions.
2 ===================================
3
4 ** Where to send the patches.
5 -----------------------------
6
7 Patches intended to be applied to Wget should be mailed to
8 <wget-patches@sunsite.auc.dk>.  Each patch will be reviewed by the
9 developers, and will be acked and added to the distribution, or
10 rejected with an explanation.
11
12 If you want to discuss your patch with the community of Wget users and
13 developers, it is OK to send it to the general list at
14 <wget@sunsite.auc.dk>.  If the patch is really huge (more than 100K or
15 so), you may want to put it on the web and post the URL.
16
17 EVERY patch should be accompanied by an explanation of what the patch
18 changes, and why the change is necessary.  The explanation need not be
19 long, but please don't just send a patch without any text.
20
21 Normally, a patch can be just inserted into the message, after the
22 explanation and the ChangeLog entry.  However, if your mail composer
23 or gateway is inclined to munge patches, e.g. by line-wrapping them,
24 please send them out as a MIME attachment.  It is important that the
25 patch survives the travel so that we can feed it to the `patch'
26 utility after reviewing it.
27
28 ** How to create patches.
29 -------------------------
30
31 Patches are created using the `diff' utility.  When making patches,
32 please use the `-u' option, or if your diff doesn't support it, `-c'.
33 Using ordinary (context-free) diffs are notoriously prone to error,
34 since line numbers tend to change when others make changes to the same
35 source file.
36
37 An example of the `diff' usage:
38
39     diff -u OLDFILE NEWFILE
40
41     -or-
42
43     diff -c OLDFILE NEWFILE
44
45 Also, it is helpful if you create the patch in the top level of
46 the Wget source directory:
47
48     $ cp src/http.c src/http.c.orig
49     ...hack, hack, hack....
50     $ diff -u src/http.c.orig src/http.c
51
52 If your patch changes more than one file, the output of all the diff
53 invocations should be concatenated to form a single patch.
54 Alternatively, you can use the `-r' option to compare entire
55 directories.  If you do that, be careful not to include the
56 differences to automatically generated files, such as `.info*'.
57
58 If you run on Windows and don't have `diff' handy, please get one.
59 It's extremely hard to review changes to files unless they're in the
60 form of a patch.  If you really cannot use a variant of `diff', then
61 mail us the whole new file and specify which version of Wget you
62 changed; that way we will be able to generate the diff ourselves.
63
64 Finally, if your changes introduce new files, or if they change the
65 old files past all recognition (e.g. by completely reimplementing the
66 old stuff), sending a patch obviously doesn't make sense.  In that
67 case, just attach the files along with an explanation of what is being
68 changed.
69
70 ** Standards and coding style.
71 ------------------------------
72
73 Wget abides by the GNU coding standards, available at:
74
75     http://www.gnu.org/prep/standards.html
76
77 To me the most important single point in that entire document is "no
78 arbitrary limits".  Even when Wget's coding is less than exemplary, it
79 respects that rule.  There should be no exceptions.
80
81 Here is a short recap of the GNU formatting and naming conventions,
82 borrowed from XEmacs:
83
84   * Put a space after every comma.
85
86   * Put a space before the parenthesis that begins a function call,
87     macro call, function declaration or definition, or control
88     statement (if, while, switch, for).  (DO NOT do this for macro
89     definitions; this is invalid preprocessor syntax.)
90
91   * The brace that begins a control statement (if, while, for, switch,
92     do) or a function definition should go on a line by itself.
93
94   * In function definitions, put the return type and all other
95     qualifiers on a line before the function name.  Thus, the function
96     name is always at the beginning of a line.
97
98   * Indentation level is two spaces.  (However, the first and
99     following statements of a while/for/if/etc. block are indented
100     four spaces from the while/for/if keyword.  The opening and
101     closing braces are indented two spaces.)
102
103   * Variable and function names should be all lowercase, with
104     underscores separating words, except for a prefixing tag, which may
105     be in uppercase.  Do not use the mixed-case convention (e.g.
106     SetVariableToValue ()) and *especially* do not use Microsoft
107     Hungarian notation (char **rgszRedundantTag).
108
109   * Preprocessor constants and enumerations should be all uppercase,
110     and should be prefixed with a tag that groups related constants
111     together.
112
113 ** ChangeLog policy.
114 --------------------
115
116 Each patch should be accompanied by an update to the appropriate
117 ChangeLog file.  Please don't mail patches to ChangeLog because they
118 have an extremely high rate of failure; just mail us the new part of
119 the ChangeLog you added.  Patches without a ChangeLog entry will be
120 accepted, but this creates additional work for the maintainers, so
121 please do write the ChangeLog entries.
122
123 Guidelines for writing ChangeLog entries are also governed by the GNU
124 coding standards, under the "Change Logs" section.