📄 patches
字号:
* Guidelines for patch submissions.===================================** What is a patch?-------------------A patch file, also known as a "diff", is a textual representation ofchanges to source code. Patches are readable enough to be reviewed byhumans and at the same time regular enough to be processed byprograms. The `patch' utility is used to change the source code inthe manner that the patch describes, this being called "applying" thepatch. Patches work even on files that have been modifiedindependently of the modifications in the patch, as long as thoseother changes do not conflict with the patch.Because of these properties, patches are the preferred means ofdistributing the changes to a free software project. If you have madea change to Wget and would like to contribute it, you will need tocreate a patch and send it to the developers; please read on.** Where to send the patches.-----------------------------Patches intended to be applied to Wget should be mailed to<wget-patches@sunsite.dk>. Each patch will be reviewed by thedevelopers, and will be acked and added to the distribution, orrejected with an explanation. Unfortunately, the developers are oftenbusy with their day jobs, so the review process can take a while.If you want to discuss your patch with the community of Wget users anddevelopers, it is OK to send it to the main list at <wget@sunsite.dk>.If the patch is really huge (more than 100K or so), you may want toput it on the web and post the URL.EVERY patch should be accompanied by an explanation of what the patchchanges, and why the change is desirable or necessary. Theexplanation need not be long, but please don't just send a patchwithout any accompanying text.Normally, a patch can be just inserted into the message, after theexplanation and the ChangeLog entry. However, if your mail composeror gateway is inclined to munge patches, e.g. by wrapping long lines,please send them out as a MIME attachment. It is important that thepatch survives the travel unchanged so that we can feed it to the`patch' utility after reviewing it.** How to create patches.-------------------------First, please make sure that you are working with the latest versionof the source -- changing obsolete code is a waste of time. Workingon the latest release is acceptable in most cases, but it is betteryet to download the very latest sources from the public CVS server andwork on those. The web page at <http://sunsite.dk/wget/> explainswhat CVS is and how to check out Wget's source code from the publicrepository.Patches are created using the `diff' program. When making patches,please use the `-u' option, or if your diff doesn't support it, `-c'.Ordinary (context-free) diffs are notoriously prone to errors, sinceline numbers tend to change when others make changes to the samesource file.In the general case, `diff' is used like this: diff -u ORIGFILE CHANGEDFILE > patch.txtAlso, it is helpful if you create the patch in the top level ofthe Wget source directory. For example: cp src/http.c src/http.c.orig ... modify src/http.c .... diff -u src/http.c.orig src/http.c > patch.txtIf your patch changes more than one file, feel free to simplyconcatenate the diffs of different files into a large diff: (diff -u foo.orig foo; diff -u bar.orig bar) > patch.txtThe alternative is to leave the unchanged source lying around and usethe `-r' option to compare entire directories: diff -ru wget-1.9.orig wget-1.9 > patch.txtIf you do that, please be careful not to include the differences toautomatically generated files, such as `.info*'.If you are using CVS, generating diffs is much simpler -- afterchanging the files, all you need to do is run the following commandfrom Wget's top-level directory: cvs diff -u > patch.txtIf you run on Windows and don't have `diff' handy, please get one.It's extremely hard to review changes to files unless they're in theform of a patch. If you really cannot use a variant of `diff', thenmail us the whole new file and specify which version of Wget youchanged; that way we will be able to generate the diff ourselves.Finally, if your changes introduce new files, or if they change theold files past all recognition (e.g. by completely reimplementing theold stuff), sending a patch obviously doesn't make sense. In thatcase, just attach the files along with an explanation of what is beingchanged.** Standards and coding style.------------------------------Wget abides by the GNU coding standards, available at: http://www.gnu.org/prep/standards.htmlI consider perhaps the most important single point in that entiredocument to be the "no arbitrary limits" rule. Even where Wget'scoding is less than exemplary, it respects that rule. There should beno exceptions.Here is a short recap of the GNU formatting and naming conventions,partly borrowed from XEmacs: * Put a space after every comma. * Put a space before the parenthesis that begins a function call, macro call, function declaration or definition, or control statement (if, while, switch, for). (DO NOT do this for macro definitions; this is invalid preprocessor syntax.) * The brace that begins a control statement (if, while, for, switch, do) or a function definition should go on a line by itself. * In function definitions, put the return type and all other qualifiers on a line before the function name. Thus, the function name is always at the beginning of a line. * Indentation level is two spaces. (However, the first and following statements of a while/for/if/etc. block are indented four spaces from the while/for/if keyword. The opening and closing braces are indented two spaces.) * Variable and function names should be all lowercase, with underscores separating words, except for a prefixing tag, which may be in uppercase. Do not use the mixed-case convention (e.g. SetVariableToValue ()) and *especially* do not use Microsoft Hungarian notation (char **rgszRedundantTag). * Preprocessor constants and enumerations should be all uppercase, and should be prefixed with a tag that groups related constants together.** ChangeLog policy.--------------------Each patch should be accompanied by an update to the appropriateChangeLog file. Please don't mail diffs of ChangeLog files becausethey have an extremely high rate of failure; just mail us the newentries you added to the ChangeLog. Patches without a ChangeLog entrywill be accepted, but this creates additional work for themaintainers, so please do take the time to write one.Guidelines for writing ChangeLog entries are also governed by the GNUcoding standards, under the "Change Logs" section.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -