source: vendor/wget/current/PATCHES@ 3754

Last change on this file since 3754 was 3440, checked in by bird, 18 years ago

wget 1.10.2

File size: 6.7 KB
Line 
1* Guidelines for patch submissions.
2===================================
3
4** What is a patch?
5-------------------
6
7A patch file, also known as a "diff", is a textual representation of
8changes to source code. Patches are readable enough to be reviewed by
9humans and at the same time regular enough to be processed by
10programs. The `patch' utility is used to change the source code in
11the manner that the patch describes, this being called "applying" the
12patch. Patches work even on files that have been modified
13independently of the modifications in the patch, as long as those
14other changes do not conflict with the patch.
15
16Because of these properties, patches are the preferred means of
17distributing the changes to a free software project. If you have made
18a change to Wget and would like to contribute it, you will need to
19create a patch and send it to the developers; please read on.
20
21** Where to send the patches.
22-----------------------------
23
24Patches intended to be applied to Wget should be mailed to
25<wget-patches@sunsite.dk>. Each patch will be reviewed by the
26developers, and will be acked and added to the distribution, or
27rejected with an explanation. Unfortunately, the developers are often
28busy with their day jobs, so the review process can take a while.
29
30If you want to discuss your patch with the community of Wget users and
31developers, it is OK to send it to the main list at <wget@sunsite.dk>.
32If the patch is really huge (more than 100K or so), you may want to
33put it on the web and post the URL.
34
35EVERY patch should be accompanied by an explanation of what the patch
36changes, and why the change is desirable or necessary. The
37explanation need not be long, but please don't just send a patch
38without any accompanying text.
39
40Normally, a patch can be just inserted into the message, after the
41explanation and the ChangeLog entry. However, if your mail composer
42or gateway is inclined to munge patches, e.g. by wrapping long lines,
43please send them out as a MIME attachment. It is important that the
44patch survives the travel unchanged so that we can feed it to the
45`patch' utility after reviewing it.
46
47** How to create patches.
48-------------------------
49
50First, please make sure that you are working with the latest version
51of the source -- changing obsolete code is a waste of time. Working
52on the latest release is acceptable in most cases, but it is better
53yet to download the very latest sources from the public Subversionn
54server and work on those. The web page at
55<http://www.gnu.org/software/wget/> explains how to get the source
56code from the repository.
57
58Patches are created using the `diff' program. When making patches,
59please use the `-u' option, or if your diff doesn't support it, `-c'.
60Ordinary (context-free) diffs are notoriously prone to errors, since
61line numbers tend to change when others make changes to the same
62source file.
63
64In the general case, `diff' is used like this:
65
66 diff -u ORIGFILE CHANGEDFILE > patch.txt
67
68Also, it is helpful if you create the patch in the top level of
69the Wget source directory. For example:
70
71 cp src/http.c src/http.c.orig
72 ... modify src/http.c ....
73 diff -u src/http.c.orig src/http.c > patch.txt
74
75If your patch changes more than one file, feel free to simply
76concatenate the diffs of different files into a large diff:
77
78 (diff -u foo.orig foo; diff -u bar.orig bar) > patch.txt
79
80The alternative is to leave the unchanged source lying around and use
81the `-r' option to compare entire directories:
82
83 diff -ru wget-1.9.orig wget-1.9 > patch.txt
84
85If you do that, please be careful not to include the differences to
86automatically generated files, such as `.info*'.
87
88If you are using Subversion, generating diffs is even simpler -- after
89changing the files, all you need to do is run the following command
90from Wget's top-level directory:
91
92 svn diff > patch.txt
93
94If you run on Windows and don't have `diff' handy, please obtain it.
95It's extremely hard to review changes to files unless they're in the
96form of a patch. If you really cannot use a variant of `diff', then
97mail us the whole new file and indicate which version of Wget you
98changed; that way we will be able to generate the diff ourselves.
99
100Finally, if your changes introduce new files, or if they change the
101old files past all recognition (e.g. by completely reimplementing the
102old stuff), sending a patch might not make sense. In that case, just
103attach the files along with an explanation of what is being changed.
104
105** Standards and coding style.
106------------------------------
107
108Wget abides by the GNU coding standards, available at:
109
110 http://www.gnu.org/prep/standards.html
111
112I consider perhaps the most important single point in that entire
113document to be the "no arbitrary limits" rule. Even where Wget's
114coding is less than exemplary, it respects that rule. There should be
115no exceptions.
116
117Here is a short recap of the GNU formatting and naming conventions,
118partly borrowed from XEmacs:
119
120 * Put a space after every comma.
121
122 * Put a space before the parenthesis that begins a function call,
123 macro call, function declaration or definition, or control
124 statement (if, while, switch, for). (DO NOT do this for macro
125 definitions; this is invalid preprocessor syntax.)
126
127 * The brace that begins a control statement (if, while, for, switch,
128 do) or a function definition should go on a line by itself.
129
130 * In function definitions, put the return type and all other
131 qualifiers on a line before the function name. Thus, the function
132 name is always at the beginning of a line.
133
134 * Indentation level is two spaces. (However, the first and
135 following statements of a while/for/if/etc. block are indented
136 four spaces from the while/for/if keyword. The opening and
137 closing braces are indented two spaces.)
138
139 * Variable and function names should be all lowercase, with
140 underscores separating words, except for a prefixing tag, which may
141 be in uppercase. Do not use the mixed-case convention (e.g.
142 SetVariableToValue ()) and *especially* do not use Microsoft
143 Hungarian notation (char **rgszRedundantTag).
144
145 * Preprocessor constants and enumerations should be all uppercase,
146 and should be prefixed with a tag that groups related constants
147 together.
148
149** ChangeLog policy.
150--------------------
151
152Each patch should be accompanied by an update to the appropriate
153ChangeLog file. Please don't mail diffs of ChangeLog files because
154they have an extremely high rate of failure; just mail us the new
155entries you added to the ChangeLog. Patches without a ChangeLog entry
156will be accepted, but this creates additional work for the
157maintainers, so please do take the time to write one.
158
159Guidelines for writing ChangeLog entries are also governed by the GNU
160coding standards, under the "Change Logs" section.
Note: See TracBrowser for help on using the repository browser.