1 <chapter id="contributing">
6 <title>Contributing code</title>
8 <para>Here are a few tips and notes that might be useful if you are
9 interested in modifying samba source code and getting it into
10 samba's main branch.</para>
14 <term>Retrieving the source</term>
17 <para>In order to contribute code to samba, make sure you have the
18 latest source. Retrieving the samba source code from CVS is
19 documented in the appendix of the Samba HOWTO Collection.
25 <term>Discuss large modifications with team members</term>
27 <para>Please discuss large modifications you are going to make
28 with members of the samba team. Some parts of the samba code
29 have one or more 'owners' - samba developers who wrote most
30 of the code and maintain it.
33 <para>This way you can avoid spending your time and effort on
34 something that is not going to make it into the main samba branch
35 because someone else was working on the same thing or because your
36 implementation is not the correct one.
42 <term>Patch format</term>
44 <para>Patches to the samba tree should be in unified diff format,
45 e.g. files generated by <userinput>diff -u</userinput>.
48 <para>If you are modifying a copy of samba you retrieved from CVS,
49 you can easily generate a diff file of these changes by running
50 <userinput>cvs diff -u</userinput>.</para>
55 <term>Points of attention when modifying samba source code</term>
58 <listitem><para>Don't simply copy code from other places and modify it until it
59 works. Code needs to be clean and logical. Duplicate
60 code is to be avoided.</para></listitem>
61 <listitem><para>Test your patch. It might take a while before one of us looks
62 at your patch so it will take longer before your patch when your patch
63 needs to go thru the review cycle again.</para></listitem>
64 <listitem><para>Don't put seperate patches in one large diff file. This makes
65 it harder to read, understand and test the patch. You might
66 also risk not getting a good patch committed because you mixed it
67 with one that had issues. </para></listitem>
68 <listitem><para>Make sure your patch complies to the samba coding style as
69 suggested in the coding-suggestions chapter. </para></listitem>
76 <term>Sending in bugfixes</term>
78 <para>Bugfixes to bugs in samba should be submitted to samba's
79 <ulink url="https://bugzilla.samba.org/">bugzilla system</ulink>,
80 along with a description of the bug.
86 <term>Sending in feature patches</term>
88 <para>Send feature patches along with a description of what the
89 patch is supposed to do to the
90 <ulink url="mailto:samba-technical@samba.org">Samba-technical mailinglist</ulink> and possibly to a samba team member who is (one of the) 'owners'
91 of the code you made modifications to. We are all busy people
92 so everybody tends to 'let one of the others handle it'. If nobody
93 responded to your patch for a week, try to send it again until you
94 get a response from one of us.
99 <term>Feedback on your patch</term>
101 <para>One of the team members will look at your patch and either
102 commit your patch or give comments why he won't apply it. In the
103 latter case you can fix your patch and re-send it until
104 your patch is approved.</para>