- made support for paged output a generic feature in wcmd
[wine/wine-kai.git] / documentation / patches.sgml
blobd1c3be10c638af709171a8bd59ae71f67a0145a9
1 <chapter id="patches">
2 <title>Submitting Patches</title>
4 <para>
5 Written by &name-albert-den-haan; <email>&email-albert-den-haan;</email>
6 </para>
7 <sect1 id="patch-format">
8 <title>Patch Format</title>
10 <para>
11 Your patch should include:
12 </para>
14 <itemizedlist>
15 <listitem>
16 <para>
17 A meaningfull subject (very short description of patch)
18 </para>
19 </listitem>
20 <listitem>
21 <para>
22 A long (paragraph) description of what was wrong and what is now
23 better (and now broken :). (recomended)
24 </para>
25 </listitem>
26 <listitem>
27 <para>
28 Change Log: A short description of what was changed.
29 </para>
30 </listitem>
31 <listitem>
32 <para>
33 Your contact information ( Name/Handle and e-mail )
34 </para>
35 </listitem>
36 <listitem>
37 <para>
38 The patch in <command>diff -u</command> format (it happens...)
39 </para>
40 </listitem>
41 </itemizedlist>
43 <para>
44 <command>cvs diff -u</command> works great for the common case
45 where a file is edited. However, if you add or remove a file
46 <command>cvs diff</command> will not report that correctly so
47 make sure you explicitly take care of this rare case.
48 </para>
49 <para>
50 For additions: mention that you have some new files and
51 include them as either separate attachments or by appending
52 the <command>diff -u /dev/null /my/new/file</command> output of them
53 to any <command>cvs diff -u</command> output you may have.
54 Alternatively, use <command>diff -Nu olddir/ newdir/</command>
55 in case of multiple new files to add.
56 </para>
57 <para>
58 For removals, list the files.
59 </para>
60 <para>
61 Since wine is constantly changing due to development it is strongly
62 recomended that you use cvs for patches, if you cannot use cvs for
63 some reason, you can submit patches against the latest tarball.
64 To do this make a copy of the files that you will be modifying and
65 <command>diff -u</command> against the old file. I.E.
66 </para>
67 <screen>
68 diff -u file.old file.c > file.txt
69 </screen>
70 </sect1>
72 <sect1 id="Style-notes">
73 <title>Some notes about style</title>
75 <para>
76 There are a few conventions that about coding style that have been
77 adopted over the years of development. The rational for these
78 <quote>rules</quote> is explained for each one.
79 </para>
80 <itemizedlist>
81 <listitem>
82 <para>
83 No HTML mail please. It is considered bad netiquette as it uglifies
84 the message, and is not viewable by many of the subscribers.
85 </para>
86 </listitem>
87 <listitem>
88 <para>
89 Only one change set per patch. Patches should address only one
90 bug/problem at a time. If a lot of changes need to be made then it
91 is perfered to break it into a series of patches. This makes it
92 easier to find regressions.
93 </para>
94 </listitem>
95 <listitem>
96 <para>
97 Tabs are not forbidden but are defined as 8 characters and the usual
98 amount of indentation is 4 characters.
99 </para>
100 </listitem>
101 <listitem>
102 <para>
103 C++ style comments are discouraged since some compilers choke on
104 them.
105 </para>
106 </listitem>
107 <listitem>
108 <para>
109 Commenting out a block of code is usually done by enclosing it in
110 <command>#if 0 ... #endif</command> Statements. For example.
111 </para>
112 <screen>
113 /* note about reason for commenting block */
114 #if 0
115 code
116 code /* comments */
117 code
118 #endif
119 </screen>
120 <para>
121 The reason for using this method is that it does not require that
122 you edit comments that may be inside the block of code.
123 </para>
124 </listitem>
125 <listitem>
126 <para>
127 Patches should be inlined (if you can configure your email client to
128 not wrap lines), or attached as plain text attachements so they can
129 be read inline. This may mean some more work for you. However it
130 allows others to review your patch easily and decreases the chances
131 of it being overlooked or forgotten.
132 </para>
133 </listitem>
134 <listitem>
135 <para>
136 Code is usually limited to 80 columns. This helps prevent mailers
137 mangling patches by line wrap. Also it generally makes code easier
138 to read.
139 </para>
140 </listitem>
141 </itemizedlist>
142 <sect2 id="Inline-Attachments-with-OE">
143 <title>Inline attachments with Outlook Express</title>
144 <para>
145 Outlook Express is notorious for mangleing attachements. Giving the
146 patch a <filename>.txt</filename> extention and attaching will solve
147 the problem for most mailers including Outlook. Also, there is a way
148 to enable Outlook Express send <filename>.diff</filename>
149 attachmnets.
150 </para>
151 <para>
152 You need following two things to make it work.
153 </para>
154 <orderedlist>
155 <listitem>
156 <para>
157 Make sure that <filename>.diff</filename> files have \r\n line
158 ends, because if OE detects that there is no \r\n line endings it
159 switches to quoted-printable format attachments.
160 </para>
161 </listitem>
162 <listitem>
163 <para>
164 Using regedit add key "Content Type" with value "text/plain"
165 to the .diff extension under HKEY_CLASSES_ROOT (same as for .txt
166 extension). This tells OE to use Content-Type: text/plain instead
167 of application/octet-stream.
168 </para>
169 </listitem>
170 </orderedlist>
171 <para>
172 Item #1 is important. After you hit "Send" button, go to "Outbox"
173 and using "Properties" verify the message source to make sure that
174 the mail has correct format. You might want to send several test
175 emails to yourself too.
176 </para>
177 </sect2>
178 </sect1>
180 <sect1 id="patch-quality">
181 <title>Quality Assurance</title>
183 <para>
184 (Or, "How do I get Alexandre to apply my patch quickly so I
185 can build on it and it will not go stale?")
186 </para>
187 <para>
188 Make sure your patch applies to the current CVS head
189 revisions. If a bunch of patches are commited to CVS that may
190 affect whether your patch will apply cleanly then verify that
191 your patch does apply! <command>cvs update</command> is your
192 friend!
193 </para>
194 <para>
195 Save yourself some embarasment and run your patched code
196 against more than just your current test example. Experience
197 will tell you how much effort to apply here.
198 </para>
200 </sect1>
201 </chapter>
203 <!-- Keep this comment at the end of the file
204 Local variables:
205 mode: sgml
206 sgml-parent-document:("wine-doc.sgml" "set" "book" "part" "chapter" "")
207 End: