2 <title>Submitting Patches</title>
4 <sect1 id="patch-format">
5 <title>Patch Format</title>
8 Patches are submitted via email to the Wine patches mailing list,
9 <email>wine-patches@winehq.org</email>. Your patch should include:
15 A meaningful subject (very short description of patch)
20 A long (paragraph) description of what was wrong and what is now
26 A change log entry (short description of what was changed).
31 The patch in <command>diff -u</command> format
41 <command>cvs diff -u</command> works great for the common case
42 where a file is edited. However, if you add or remove a file
43 <command>cvs diff</command> will not report that correctly so
44 make sure you explicitly take care of this rare case.
47 For additions simply include them by appending the
48 <command>diff -u /dev/null /my/new/file</command> output of them
49 to any <command>cvs diff -u</command> output you may have.
50 Alternatively, use <command>diff -Nu olddir/ newdir/</command>
51 in case of multiple new files to add.
54 For removals, clearly list the files in the description of the patch.
57 Since wine is constantly changing due to development it is strongly
58 recommended that you use cvs for patches, if you cannot use cvs for
59 some reason, you can submit patches against the latest tarball.
60 To do this make a copy of the files that you will be modifying and
61 <command>diff -u</command> against the old file. I.E.
64 diff -u file.old file.c > file.txt
68 <sect1 id="Style-notes">
69 <title>Some notes about style</title>
72 There are a few conventions that about coding style that have been
73 adopted over the years of development. The rational for these
74 <quote>rules</quote> is explained for each one.
79 No HTML mail, since patches should be in-lined and HTML turns the
80 patch into garbage. Also it is considered bad etiquette as it
81 uglifies the message, and is not viewable by many of the subscribers.
86 Only one change set per patch. Patches should address only one
87 bug/problem at a time. If a lot of changes need to be made then it
88 is preferred to break it into a series of patches. This makes it
89 easier to find regressions.
94 Tabs are not forbidden but discouraged. A tab is defined as
95 8 characters and the usual amount of indentation is 4
101 C++ style comments are discouraged since some compilers choke on
107 Commenting out a block of code is usually done by enclosing it in
108 <command>#if 0 ... #endif</command> Statements. For example.
111 /* note about reason for commenting block */
119 The reason for using this method is that it does not require that
120 you edit comments that may be inside the block of code.
125 Patches should be in-lined (if you can configure your email client to
126 not wrap lines), or attached as plain text attachments so they can
127 be read inline. This may mean some more work for you. However it
128 allows others to review your patch easily and decreases the chances
129 of it being overlooked or forgotten.
134 Code is usually limited to 80 columns. This helps prevent mailers
135 mangling patches by line wrap. Also it generally makes code easier
140 <sect2 id="Inline-Attachments-with-OE">
141 <title>Inline attachments with Outlook Express</title>
143 Outlook Express is notorious for mangling attachments. Giving the
144 patch a <filename>.txt</filename> extension and attaching will solve
145 the problem for most mailers including Outlook. Also, there is a way
146 to enable Outlook Express send <filename>.diff</filename>
150 You need following two things to make it work.
155 Make sure that <filename>.diff</filename> files have \r\n line
156 ends, because if OE detects that there is no \r\n line endings it
157 switches to quoted-printable format attachments.
162 Using regedit add key "Content Type" with value "text/plain"
163 to the .diff extension under HKEY_CLASSES_ROOT (same as for .txt
164 extension). This tells OE to use Content-Type: text/plain instead
165 of application/octet-stream.
170 Item #1 is important. After you hit "Send" button, go to "Outbox"
171 and using "Properties" verify the message source to make sure that
172 the mail has correct format. You might want to send several test
173 emails to yourself too.
176 <sect2 id="Alexandre-Bottom-Line">
177 <title>Alexandre's Bottom Line</title>
179 <quote>The basic rules are: no attachments, no mime crap, no
180 line wrapping, a single patch per mail. Basically if I can't
181 do <command>"cat raw_mail | patch -p0"</command> it's in the
182 wrong format.</quote>
187 <sect1 id="patch-quality">
188 <title>Quality Assurance</title>
191 (Or, "How do I get Alexandre to apply my patch quickly so I
192 can build on it and it will not go stale?")
195 Make sure your patch applies to the current CVS head
196 revisions. If a bunch of patches are committed to CVS that may
197 affect whether your patch will apply cleanly then verify that
198 your patch does apply! <command>cvs update</command> is your
202 Save yourself some embarrassment and run your patched code
203 against more than just your current test example. Experience
204 will tell you how much effort to apply here.
210 <!-- Keep this comment at the end of the file
213 sgml-parent-document:("wine-devel.sgml" "set" "book" "part" "chapter" "")