Updated ChangeLog
[barry.git] / doc / www / patches.php
blob558aae890f338e92a0edf5649e0c7df31ad893ae
1 <? include ("barry.inc"); ?>
3 <? createHeader("Submitting Patches"); ?>
5 <? createSubHeader("Coding Guidelines"); ?>
7 <p>If you are submitting code, please have a look at the
8 <? createLink("codingguide", "Coding Guidelines page"); ?>.</p>
10 <p>Please keep some things in mind when preparing your patches
11 for submission:
12 <ul>
13 <li>use one patch per logical change</li>
14 <li>test all coding changes</li>
15 <ul>
16 <li>If it is a change to the build system, make sure that
17 the test/buildtest.sh script still works.</li>
18 </ul>
19 <li>include some commentary above your patch in your email</li>
20 <li>when mailing patches, try to keep one patch per email</li>
21 <li>do not cut and paste patches... either read them in
22 directly to your mail body (preferred),
23 or send as an attachment</li>
24 <li>add a [PATCH] prefix to your subject line</li>
25 </ul>
26 </p>
29 <? createSubHeader("Why Submit Patches?"); ?>
31 <p>Submitting your changes via patch is a good thing. It may seem like
32 an extra bit of work to create a patch and post it to the mailing list,
33 or to make your work available in a public git repo, but there are good
34 reasons why Open Source works that way:</p>
36 <ul>
37 <li>Patches tell the maintainer that you <b>want</b> your change
38 to be added to the tree. It is often too easy for busy
39 programmers to misunderstand someone's intentions if
40 they just send a random file. If intentions are not
41 clear, work gets dropped on the floor.</li>
42 <li>Patches show that you have worked with the source code,
43 and hopefully have tested your change.</li>
44 <li>Patches show that you have given some thought to where
45 your changes should go in the tree.</li>
46 <li>Patches to a public mailing list encourage peer review, and show
47 that you are ok with your code being included in a public
48 project.</li>
49 <li>Patches to a public mailing list or a public repository become
50 part of history, showing who did what, and when.</li>
51 <li>Patches usually get top priority from developers.</li>
52 <li>Patches make life easier for the developers, freeing up their
53 time for more features and bug fixes.</li>
54 <li>Patches turn you into a developer. Your name can be added
55 to the AUTHORS file.</li>
56 </ul>
59 <? createSubHeader("Generating Patches"); ?>
61 <p>Generating patches depends on the method you used to get the source code.
62 <ul>
63 <li>If you are using a tarball, expand the tarball once into
64 a pristine directory, and again into your "working
65 directory." When you are finished and
66 ready to patch, do:
67 <pre>
68 cd barry-work
69 ./buildgen.sh cleanall
70 cd ..
71 diff -ruN barry-orig barry-work > patchfile
72 </pre>
73 </li>
75 <li>If you are using CVS, make your changes in your working
76 directory, and then do:
77 <pre>
78 cd barry-cvs
79 ./buildgen.sh cleanall
80 cvs diff -u > patchfile
81 grep ^? patchfile
82 </pre>
83 Any new files that you've added to your tree will need
84 to be attached to your patch email, as CVS has no
85 way to add files without write access to the repository.
86 <br/><br/></li>
88 <li>If you are using the git tree, you can make your changes
89 in your own branch, and then create patches for each
90 commit you've made:
91 <pre>
92 cd barry-git
93 git format-patch origin/master
94 </pre>
96 </li>
98 </ul>
101 <? createSubHeader("Methods for Submitting Patches"); ?>
103 <p>Submitting changes can happen in one of three methods:
105 <ul>
106 <li>Send a patch to the
107 <a href="http://sourceforge.net/mail/?group_id=153722">mailing list</a>.
108 </li>
110 <li>Publish your own git repository (perhaps by creating a
111 forked tree on
112 <a href="http://repo.or.cz/">repo.or.cz</a>)
113 and notify the mailing list, indicating the
114 branch you want people to pull from when
115 you're ready.</li>
117 <li>Use the "mob" branch on <a href="http://repo.or.cz/w/barry.git">
118 Barry's git repository</a>, and....
119 send a notification to the mailing list.</li>
120 </ul>
121 </p>
124 <? createSubHeader("Creating a Forked Tree on repo.or.cz"); ?>
126 <p>The git repo site repo.or.cz lets anyone create a forked tree based
127 off the official Barry repo. This saves space on repo.or.cz, and
128 adds your fork to a list at the bottom of the official Barry page.</p>
130 <p>This way, users and developers can look at everyone's changes and
131 test and mix them as needed.</p>
133 <p>To create a forked tree, visit the <a href="http://repo.or.cz/w/barry.git">
134 Barry repo</a> and click "fork" at the top.</p>
138 <? createSubHeader("Using the Mob Branch"); ?>
140 <p>The public git repository service at repo.or.cz provides an interesting
141 feature, which allows anyone to push to a "mob" branch of a repository,
142 if so configured by the admin.</p>
144 <p> It would go something like this:
145 <pre>
146 # clone with mob user
147 git clone git+ssh://mob@repo.or.cz/srv/git/barry.git barry
149 cd barry
150 git checkout -b mob origin/mob
151 git diff origin/master..mob # make sure master == mob
152 &lt;make changes&gt;
153 git add ... && git commit
154 git push origin mob
155 &lt;send email to the list, include the SHA1 sum of the commit&gt;
156 </pre>
157 </p>
159 <p> This is a novel idea, as well as a security risk for anyone who blindly
160 runs whatever is in the mob branch. Hence the recommended diff check
161 above, to make sure you're working on an official branch.</p>
163 <p> The mob user can only push to the mob branch, so all other branches
164 are read-only, and have been reviewed at least once by the project
165 maintainer.</p>
167 <p> But the mob branch frees people up to use git, who may not have
168 their own hosting, or who may not want to bother setting up their
169 own git repo. People can use it to collaborate on a feature as well.
170 Let your imagination run wild.</p>
172 <p>You can read more about the ideas behind the mob branch at
173 <a href="http://repo.or.cz/mob.html">the repo.or.cz mob page</a></p>