2 About Subversion write access:
3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 Before everything else, you should know how to use Subversion properly.
6 Luckily Subversion comes with excellent documentation.
10 shows you the available subcommands,
14 shows information about the subcommand <command>.
16 The most comprehensive manual is the book "Version Control with Subversion"
17 by Ben Collins-Sussman, Brian W. Fitzpatrick and C. Michael Pilato. It can
22 For more information about the Subversion project, visit
24 http://subversion.apache.org/
26 Consult these resources whenever you have problems, they are quite exhaustive.
28 You do not need a special checkout that works through ssh or similar in order
29 to be able to commit changes. All you need is the username and password pair
30 that you received from the MPlayer Subversion server admin.
32 What follows now is a basic introduction to Subversion and some MPlayer-specific
33 guidelines. Read it at least once, if you are granted commit privileges to the
34 MPlayer project you are expected to be familiar with these rules.
43 The MPlayer project server runs Subversion 1.5. For optimal compatibility
44 you should use version 1.5 or later.
47 1. Checking out the source tree:
49 svn checkout svn://svn.mplayerhq.hu/mplayer/trunk/ <target>
51 This will put the MPlayer sources into the directory <target>.
54 2. Updating the source tree to the latest revision:
58 pulls in the latest changes from the repository to your working directory.
61 3. Adding/removing files/directories:
63 svn add <filename/dirname>
64 svn delete <filename/dirname>
66 Subversion needs to get notified of all changes you make to your working
70 4. Showing modifications:
72 svn diff <filename(s)>
74 will show all local modifications in your working directory as unified diff.
77 5. Inspecting the changelog:
81 You may also find viewvc, a web frontend for Subversion, helpful. It's often
82 more comfortable than using 'svn log' and 'svn diff'. Find it here:
83 http://svn.mplayerhq.hu/mplayer/trunk/
86 6. Checking source tree status:
90 detects all the changes you made and lists what actions will be taken in case
91 of a commit (additions, modifications, deletions, etc.).
98 Run 'svn update' before committing to make sure there were no changes to the
99 files you worked on in the meantime. Afterwards look at the output of
101 svn diff <filename(s)>
103 to doublecheck your changes before committing to avoid trouble later on. All
104 experienced developers do this on each and every commit, no matter how small.
105 Every one of them has been saved from looking like a fool by this many times.
106 It's very easy for stray debug output or cosmetic modifications to slip in,
107 please avoid problems through this extra level of scrutiny.
109 For cosmetics-only commits you should get (almost) empty output from
111 svn diff -x -uwb <filename(s)>
113 Also check the output of
117 to make sure you did not forget to 'svn add' some files (they will be marked
120 Once you have made sure everything is fine
122 svn commit <filename(s)>
124 propagates your stuff to the repository. If you have made several independent
125 changes, commit them separately, not at the same time.
127 When prompted for a password, type the password you got assigned by the
128 project admins. By default, Subversion caches all authentication tokens.
129 This behavior can be disabled by setting both 'store-passwords' and
130 'store-auth-creds' to "no" in ~/.subversion/config. You might need to remove
131 previous cache files, which are located in ~/.subversion/auth, by hand.
133 You will be prompted for a log message in an editor, which is either specified
134 by --editor-cmd on the command line, set in your personal configuration file
135 (~/.subversion/config) or set by one of the following environment variables:
136 SVN_EDITOR, VISUAL or EDITOR.
138 Log messages should be concise but descriptive. Explain why you made a change,
139 what you did will be obvious from the changes themselves most of the time.
140 Saying just "bug fix" or "10l" is bad. Remember that people of varying skill
141 levels look at and educate themselves while reading through your code. Don't
142 include filenames in log messages, Subversion provides that information.
145 8. Renaming/moving/copying files or contents of files:
147 svn move/copy <source> <destination>
148 svn commit <source> <destination>
150 Do not move, rename or copy files of which you are not the maintainer without
151 discussing it on the mplayer-dev-eng mailing list first!
153 Never copy or move a file by using 'svn delete' and 'svn add'. Always use
154 'svn move' or 'svn copy' instead in order to preserve history and minimize
157 To split a file, use 'svn copy' and remove the unneeded lines from each file.
159 Don't do a lot of cut'n'paste from one file to another without a very good
160 reason and discuss it on the mplayer-dev-eng mailing list first. It will make
161 those changes hard to trace.
163 Such actions are useless and treated as cosmetics in 99% of cases,
164 so try to avoid them.
167 9. Reverting broken commits
169 There are 2 ways to reverse a change, they differ significantly in what they
170 do to the repository.
171 The recommit old method:
174 This simply changes the file(s) back to their old version locally and then
175 the change is committed as if it were a new change.
178 svn cp -r<good revision> svn://svn.mplayerhq.hu/mplayer/trunk/[<path>/]<file> <file>
180 This simply removes the file and then copies the last good version with
181 its history over it. This method can only be used to revert the n last
182 commits but not to revert a bad commit in the middle of its history.
183 Neither method will change the history, checking out an old version will
184 always return exactly that revision with all its bugs and features. The
185 difference is that with the svn copy method the broken commit will not be
186 part of the directly visible history of the revisions after the reversal
187 So if the change was completely broken like reindenting a file against the
188 maintainers decision, or a change which mixed functional and cosmetic
189 changes then it is better if it is not part of the visible history as it
190 would make it hard to read, review and would also break svn annotate.
191 For the example of a change which mixed functional and cosmetic parts they
192 should of course be committed again after the reversal but separately, so one
193 change with the functional stuff and one with the cosmetics.
194 OTOH if the change which you want to reverse was simply buggy but not
195 totally broken then it should be reversed with svn merge as otherwise
196 the fact that the change was bad would be hidden.
197 One method to decide which reversal method is best is to ask yourself
198 if there is any value in seeing the whole bad change and its removal
199 in SVN vs. just seeing a comment that says what has been reversed while
200 the actual change does not clutter the immediately visible history and
202 If you are even just slightly uncertain how to revert something then ask on
203 the mplayer-dev-eng mailing list.
206 10. Reverting local changes
208 svn revert <filename(s)>
210 In case you made a lot of local changes to a file and want to start over
211 with a fresh checkout of that file, you can use 'svn revert <filename(s)>'.
212 NOTE: This has nothing to do with reverting changes on the Subversion
213 server! It only reverts changes that were not committed yet. If you need
214 to revert a broken commit, see 9.
217 11. Changing commit messages
219 svn propedit svn:log --revprop -r <revision>
221 If your commit message is too short or not explanatory enough, you can edit
222 it afterwards with 'svn propedit'.
225 Contact the project admins <root at mplayerhq dot hu> if you have technical
226 problems with the Subversion server.
233 1. You must not commit code which breaks MPlayer! (Meaning unfinished but
234 enabled code which breaks compilation or compiles but does not work.)
235 You can commit unfinished stuff (for testing etc), but it must be disabled
236 (#ifdef etc) by default so it does not interfere with other developers'
240 2. You don't have to over-test things. If it works for you, and you think it
241 should work for others, too, then commit. If your code has problems
242 (portability, exploits compiler bugs, unusual environment etc) they will be
243 reported and eventually fixed.
246 3. Do not commit unrelated changes together, split them into self-contained
247 pieces, but not smaller. Do not split commits by files or directories,
248 keep related changes together.
251 4. Do not change behavior of the program (renaming options etc) or remove
252 functionality from the code without approval in a discussion on the
253 mplayer-dev-eng mailing list.
256 5. Do not commit changes which change behavior, defaults etc, without asking
257 first. The same applies to compiler warning fixes, trivial looking fixes and
258 to code maintained by other developers. We usually have a reason for doing
259 things the way we do. Send your changes as patches to the mplayer-dev-eng
260 mailing list, and if the code maintainers say OK, you may commit. This does
261 not apply to files you wrote and/or maintain.
264 6. We refuse source indentation and other cosmetic changes if they are mixed
265 with functional changes, such commits will be rejected and removed. Every
266 developer has his own indentation style, you should not change it. Of course
267 if you (re)write something, you can use your own style... (Many projects
268 force a given indentation style - we don't.) If you really need to make
269 indentation changes (try to avoid this), separate them strictly from real
272 NOTE: If you had to put if(){ .. } over a large (> 5 lines) chunk of code,
273 do NOT change the indentation of the inner part (don't move it to the right)!
276 7. Always fill out the commit log message. Describe in a few lines what you
277 changed and why. You can refer to mailing list postings if you fix a
278 particular bug. Comments such as "fixed!" or "Changed it." are unacceptable.
281 8. If you apply a patch by someone else, include the name and email address in
282 the log message. Since the mplayer-cvslog mailing list is publicly archived
283 you should add some spam protection to the email address. Send an answer to
284 mplayer-dev-eng (or wherever you got the patch from) saying that you applied
285 the patch. If the patch contains a documentation change, commit that as
286 well; do not leave it to the documentation maintainers.
289 9. Do NOT commit to code actively maintained by others without permission. Send
290 a patch to mplayer-dev-eng instead.
293 10. Subscribe to the mplayer-cvslog mailing list. The diffs of all commits
294 are sent there and reviewed by all the other developers. Bugs and possible
295 improvements or general questions regarding commits are discussed there. We
296 expect you to react if problems with your code are uncovered.
299 11. Update the documentation if you change behavior or add features. If you are
300 unsure how best to do this, send a patch to mplayer-docs, the documentation
301 maintainers will review and commit your stuff.
304 12. Always send a patch to the mplayer-dev-eng mailing list before committing
305 if you suspect that the change is going to be controversial. Based on past
306 experience, these changes are likely to be controversial:
307 - feature removal, even if obsolete
308 - changes to "special" output messages (like the "Core dumped ;)" message)
309 - verbosity changes from default (info) level
310 - changes to "historical" parts of docs and web pages
311 - use of internal or external libraries
312 - reverting commits from other developers
313 - making the spelling of words consistent without actually correcting
317 13. Try to keep important discussions and requests (also) on the mplayer-dev-eng
318 mailing list, so that all developers can benefit from them.
319 IRC is good for quick discussions, but nobody is there 24/7.
322 14. MPlayer contains some external code that is partly patched, partly copied
323 verbatim (see Copyright for details). This code should not be modified
324 unless there is a very good reason. Much of it is maintained upstream.
325 We should be good open source citizens, submit our fixes upstream and keep
326 the differences as small as possible.
327 If you have to modify external code, do not forget to update the diff file
328 with our local changes.
331 Also read DOCS/tech/patches.txt !!!!
333 We think our rules are not too hard. If you have comments, contact us.
340 The typical flow of development would be:
342 1. Check out the source:
344 svn checkout svn://svn.mplayerhq.hu/mplayer/trunk/ devel
347 2. Make your changes.
352 Run 'svn diff' from the root of the source tree, like this:
355 svn diff > ../my_changes.patch
357 If you have made several changes, but only want to submit one for review
358 by other developers, you can specify the filename(s), for example:
360 svn diff mplayer.c > ../major_cleanup.patch
365 Check out another, clean source tree and verify your patch:
367 svn checkout svn://svn.mplayerhq.hu/mplayer/trunk/ clean
369 patch -p0 --dry-run < ../my_changes.patch
371 If there are no errors, you can apply your patch:
373 patch -p0 < ../my_changes.patch
375 After that, verify that MPlayer still builds correctly with your patch
376 applied. Also, be sure that your patch meets our policy as described in
377 section II, specifically rules 1 to 6, before you continue submitting
383 Send an e-mail to the mplayer-dev-eng mailing list. Describe what your
384 patch does and why, and attach the patch file for review by others.
387 6. During the review process, incorporate all suggested fixes. Go to step 2
388 repeatedly until there is nothing more to do for step 6. Of course, if
389 you don't agree with certain suggestions, things can be discussed on
390 the mailing list in a polite manner.
395 If your patch is accepted, double check if your source tree contains the
396 most recent version of your patch with 'svn diff'! After verifying that
397 you met these conditions, commit with:
399 svn commit <filename(s)>
401 Go to step 2 ad infinitum until MPlayer is the perfect media player ;)
404 Note: If you are listed as the maintainer for a particular piece of code,
405 you can skip step 5 and 6 if your patch _only_ applies to the code you
406 maintain. If it touches other code or is otherwise very intrusive, please
407 post it to mplayer-dev-eng first.