Mercurial > mplayer.hg
annotate DOCS/tech/svn-howto.txt @ 19359:06e9e957ceca
editorial spelling/wording/grammar changes
author | diego |
---|---|
date | Thu, 10 Aug 2006 21:08:49 +0000 |
parents | 59af53f4f436 |
children | be3a0f578824 |
rev | line source |
---|---|
2200 | 1 |
18660 | 2 About Subversion write access: |
3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
2200 | 4 |
18705 | 5 Before everything else, you should know how to use Subversion properly. |
18840 | 6 Luckily Subversion comes with excellent documentation. |
11395
5484bc13e90a
Some notes about general CVS documentation added, new 'cvs admin' section
diego
parents:
9537
diff
changeset
|
7 |
18705 | 8 svn help |
18840 | 9 |
10 shows you the available subcommands, | |
11 | |
12 svn help <command> | |
11395
5484bc13e90a
Some notes about general CVS documentation added, new 'cvs admin' section
diego
parents:
9537
diff
changeset
|
13 |
18840 | 14 shows information about the subcommand <command>. |
15 | |
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 | |
18 be viewed online at | |
11395
5484bc13e90a
Some notes about general CVS documentation added, new 'cvs admin' section
diego
parents:
9537
diff
changeset
|
19 |
18705 | 20 http://svnbook.org/ |
11395
5484bc13e90a
Some notes about general CVS documentation added, new 'cvs admin' section
diego
parents:
9537
diff
changeset
|
21 |
18705 | 22 For more information about the Subversion project, visit |
11395
5484bc13e90a
Some notes about general CVS documentation added, new 'cvs admin' section
diego
parents:
9537
diff
changeset
|
23 |
18705 | 24 http://subversion.tigris.org/ |
11395
5484bc13e90a
Some notes about general CVS documentation added, new 'cvs admin' section
diego
parents:
9537
diff
changeset
|
25 |
5484bc13e90a
Some notes about general CVS documentation added, new 'cvs admin' section
diego
parents:
9537
diff
changeset
|
26 Consult these resources whenever you have problems, they are quite exhaustive. |
18840 | 27 |
28 What follows now is a basic introduction to Subversion and some MPlayer-specific | |
29 guidelines. Read it at least once, if you are granted commit privileges to the | |
30 MPlayer project you are expected to be familiar with these rules. | |
11395
5484bc13e90a
Some notes about general CVS documentation added, new 'cvs admin' section
diego
parents:
9537
diff
changeset
|
31 |
7904
98168d30f67d
Spellchecked, reworded, reformatted, small additions and corrections.
diego
parents:
5415
diff
changeset
|
32 |
18841 | 33 |
18840 | 34 I. BASICS: |
35 ========== | |
36 | |
19248
dd30cb46819d
Add a paragraph about which Subversion version to use.
diego
parents:
18845
diff
changeset
|
37 0. Get Subversion: |
dd30cb46819d
Add a paragraph about which Subversion version to use.
diego
parents:
18845
diff
changeset
|
38 |
dd30cb46819d
Add a paragraph about which Subversion version to use.
diego
parents:
18845
diff
changeset
|
39 The MPlayer project server runs Subversion 1.2.3. For optimal compatibility |
dd30cb46819d
Add a paragraph about which Subversion version to use.
diego
parents:
18845
diff
changeset
|
40 you should use version 1.2.3 or later. |
dd30cb46819d
Add a paragraph about which Subversion version to use.
diego
parents:
18845
diff
changeset
|
41 |
dd30cb46819d
Add a paragraph about which Subversion version to use.
diego
parents:
18845
diff
changeset
|
42 |
18840 | 43 1. Checking out the source tree: |
7904
98168d30f67d
Spellchecked, reworded, reformatted, small additions and corrections.
diego
parents:
5415
diff
changeset
|
44 |
18840 | 45 svn checkout svn://svn.mplayerhq.hu/mplayer/trunk/ <target> |
2200 | 46 |
18840 | 47 This will put the MPlayer sources into the directory <target>. |
2200 | 48 |
18841 | 49 |
18840 | 50 2. Updating the source tree to the latest revision: |
18706 | 51 |
52 svn update | |
12024 | 53 |
18840 | 54 pulls in the latest changes from the repository to your working directory. |
55 | |
18841 | 56 |
18840 | 57 3. Adding/removing files/directories: |
58 | |
59 svn add <filename/dirname> | |
60 svn delete <filename/dirname> | |
61 | |
62 Subversion needs to get notified of all changes you make to your working | |
63 directory. | |
64 | |
18841 | 65 |
18840 | 66 4. Showing modifications: |
67 | |
68 svn diff <filename(s)> | |
69 | |
70 will show all local modifications in your working directory as unified diff. | |
71 | |
18841 | 72 |
18840 | 73 5. Inspecting the changelog: |
74 | |
75 svn log <filename(s)> | |
76 | |
77 You may also find viewvc, a web frontend for Subversion, helpful. It's often | |
78 more comfortable than using 'svn log' and 'svn diff'. Find it here: | |
79 http://svn.mplayerhq.hu/mplayer/trunk/ | |
80 | |
18841 | 81 |
18840 | 82 6. Checking source tree status: |
83 | |
84 svn status | |
85 | |
86 detects all the changes you made and lists what actions will be taken in case | |
87 of a commit (additions, modifications, deletions, etc.). | |
88 | |
18841 | 89 |
18840 | 90 7. Committing: |
2200 | 91 |
18767 | 92 svn update |
18840 | 93 |
94 Run 'svn update' before committing to make sure there were no changes to the | |
95 files you worked on in the meantime. Afterwards look at the output of | |
96 | |
97 svn diff <filename(s)> | |
12024 | 98 |
18840 | 99 to doublecheck your changes before committing to avoid trouble later on. All |
100 experienced developers do this on each and every commit, no matter how small. | |
101 Every one of them has been saved from looking like a fool by this many times. | |
102 It's very easy for stray debug output or cosmetic modifications to slip in, | |
103 please avoid problems through this extra level of scrutiny. | |
104 | |
105 Once you have made sure everything is fine | |
106 | |
107 svn commit <filename(s)> | |
108 | |
109 propagates your stuff to the repository. If you have made several independent | |
110 changes, commit them separately, not at the same time. | |
111 | |
112 When prompted for a password, type the password you got assigned by the | |
113 project admins. By default, Subversion caches all authentication tokens. | |
114 This behaviour can be disabled by setting both 'store-passwords' and | |
18706 | 115 'store-auth-creds' to "no" in ~/.subversion/config. You might need to remove |
116 previous cache files, which are located in ~/.subversion/auth, by hand. | |
12024 | 117 |
18840 | 118 You will be prompted for a log message in an editor, which is either specified |
119 by --editor-cmd on the command line, set in your personal configuration file | |
120 (~/.subversion/config) or set by one of the following environment variables: | |
121 SVN_EDITOR, VISUAL or EDITOR. | |
12024 | 122 |
18840 | 123 Log messages should be concise but descriptive. Explain why you made a change, |
124 what you did will be obvious from the changes themselves most of the time. | |
125 Saying just "bug fix" or "10l" is bad. Remember that people of varying skill | |
126 levels look at and educate themselves while reading through your code. Don't | |
127 include filenames in log messages, Subversion provides that information. | |
18706 | 128 |
18841 | 129 |
19357
59af53f4f436
update the moving & copying rules as disscussed on mplayer-dev + some (but not all as iam lazy) fixes by the wanderer
michael
parents:
19248
diff
changeset
|
130 8. Renaming/moving/copying files or contents of files: |
13288 | 131 |
19359 | 132 svn move <source> <destination> |
133 svn copy <source> <destination> | |
18840 | 134 svn commit <source> <destination> |
2200 | 135 |
19359 | 136 Do not move, rename or copy files not maintained by you without discussing |
137 it on the mplayer-dev-eng mailing list first! | |
19357
59af53f4f436
update the moving & copying rules as disscussed on mplayer-dev + some (but not all as iam lazy) fixes by the wanderer
michael
parents:
19248
diff
changeset
|
138 |
19359 | 139 In order to preserve history and minimize the size of diffs, do not copy or |
140 move a file by using 'svn delete' and 'svn add'. Always use 'svn move' or | |
141 'svn copy' instead. | |
19357
59af53f4f436
update the moving & copying rules as disscussed on mplayer-dev + some (but not all as iam lazy) fixes by the wanderer
michael
parents:
19248
diff
changeset
|
142 |
19359 | 143 To split a file use 'svn copy' and remove the unneeded lines from each file. |
2200 | 144 |
7904
98168d30f67d
Spellchecked, reworded, reformatted, small additions and corrections.
diego
parents:
5415
diff
changeset
|
145 Don't do a lot of cut'n'paste from one file to another without a very good |
98168d30f67d
Spellchecked, reworded, reformatted, small additions and corrections.
diego
parents:
5415
diff
changeset
|
146 reason and discuss it on the mplayer-dev-eng mailing list first. It will make |
18840 | 147 those changes hard to trace. |
5415 | 148 |
7904
98168d30f67d
Spellchecked, reworded, reformatted, small additions and corrections.
diego
parents:
5415
diff
changeset
|
149 Such actions are useless and treated as cosmetics in 99% of cases, |
98168d30f67d
Spellchecked, reworded, reformatted, small additions and corrections.
diego
parents:
5415
diff
changeset
|
150 so try to avoid them. |
11395
5484bc13e90a
Some notes about general CVS documentation added, new 'cvs admin' section
diego
parents:
9537
diff
changeset
|
151 |
18841 | 152 |
11395
5484bc13e90a
Some notes about general CVS documentation added, new 'cvs admin' section
diego
parents:
9537
diff
changeset
|
153 9. Reverting broken commits |
5484bc13e90a
Some notes about general CVS documentation added, new 'cvs admin' section
diego
parents:
9537
diff
changeset
|
154 |
18706 | 155 There is no Subversion equivalent of the 'cvs admin -o' command. Instead, |
156 be very careful about what you commit! If somehow you broke something, | |
157 revert the changes locally and re-commit with a proper commit message. | |
18840 | 158 You may want to use 'svn cat -r<revision> <filename>' to inspect an older |
18706 | 159 revision. |
15227
167085fd11af
'cvs admin -o' is dangerous and should be handled with extra care.
diego
parents:
14856
diff
changeset
|
160 |
18841 | 161 |
18840 | 162 10. Reverting local changes |
11395
5484bc13e90a
Some notes about general CVS documentation added, new 'cvs admin' section
diego
parents:
9537
diff
changeset
|
163 |
18840 | 164 svn revert <filename(s)> |
14806
6abe4fb845ff
mphq uses ssh.com, explain RSA key generation for it.
diego
parents:
14059
diff
changeset
|
165 |
18706 | 166 In case you made a lot of local changes to a file and want to start over |
18840 | 167 with a fresh checkout of that file, you can use 'svn revert <filename(s)>'. |
18706 | 168 NOTE: This has nothing to do with reverting changes on the Subversion |
169 server! It only reverts changes that were not committed yet. If you need | |
170 to revert a broken commit, see 9. | |
11395
5484bc13e90a
Some notes about general CVS documentation added, new 'cvs admin' section
diego
parents:
9537
diff
changeset
|
171 |
18841 | 172 |
18840 | 173 11. Changing commit messages |
18764
5b89070daa50
add command for changing commit messages after the commit took place.
ivo
parents:
18706
diff
changeset
|
174 |
5b89070daa50
add command for changing commit messages after the commit took place.
ivo
parents:
18706
diff
changeset
|
175 svn propedit svn:log --revprop -r <revision> |
5b89070daa50
add command for changing commit messages after the commit took place.
ivo
parents:
18706
diff
changeset
|
176 |
5b89070daa50
add command for changing commit messages after the commit took place.
ivo
parents:
18706
diff
changeset
|
177 If your commit message is too short or not explanatory enough, you can edit |
18845 | 178 it afterwards with 'svn propedit'. |
18764
5b89070daa50
add command for changing commit messages after the commit took place.
ivo
parents:
18706
diff
changeset
|
179 |
18841 | 180 |
18840 | 181 Contact the project admins <root at mplayerhq dot hu> if you have technical |
18706 | 182 problems with the Subversion server. |
7904
98168d30f67d
Spellchecked, reworded, reformatted, small additions and corrections.
diego
parents:
5415
diff
changeset
|
183 |
2200 | 184 |
185 | |
186 II. POLICY / RULES: | |
187 =================== | |
188 | |
13288 | 189 1. You must not commit code which breaks MPlayer! (Meaning unfinished but |
7904
98168d30f67d
Spellchecked, reworded, reformatted, small additions and corrections.
diego
parents:
5415
diff
changeset
|
190 enabled code which breaks compilation or compiles but does not work.) |
13288 | 191 You can commit unfinished stuff (for testing etc), but it must be disabled |
192 (#ifdef etc) by default so it does not interfere with other developers' | |
193 work. | |
2200 | 194 |
18841 | 195 |
7904
98168d30f67d
Spellchecked, reworded, reformatted, small additions and corrections.
diego
parents:
5415
diff
changeset
|
196 2. You don't have to over-test things. If it works for you, and you think it |
98168d30f67d
Spellchecked, reworded, reformatted, small additions and corrections.
diego
parents:
5415
diff
changeset
|
197 should work for others, too, then commit. If your code has problems |
98168d30f67d
Spellchecked, reworded, reformatted, small additions and corrections.
diego
parents:
5415
diff
changeset
|
198 (portability, exploits compiler bugs, unusual environment etc) they will be |
98168d30f67d
Spellchecked, reworded, reformatted, small additions and corrections.
diego
parents:
5415
diff
changeset
|
199 reported and eventually fixed. |
2200 | 200 |
18841 | 201 |
13288 | 202 3. Do not commit unrelated changes together, split them into self-contained |
203 pieces. | |
2200 | 204 |
18841 | 205 |
17578 | 206 4. Do not change behavior of the program (renaming options etc) or |
17579
f1ce086b5eed
Clarify feature removal policy: it must be approved on the mailing list.
rathann
parents:
17578
diff
changeset
|
207 remove functionality from the code without approval in a discussion on |
f1ce086b5eed
Clarify feature removal policy: it must be approved on the mailing list.
rathann
parents:
17578
diff
changeset
|
208 the mplayer-dev-eng mailing list. |
12024 | 209 |
18841 | 210 |
13288 | 211 5. Do not commit changes to the build system (Makefiles, configure script) |
212 which change behaviour, defaults etc, without asking first. The same | |
213 applies to compiler warning fixes, trivial looking fixes and to code | |
214 maintained by other developers. We usually have a reason for doing things | |
215 the way we do. Send your changes as patches to the mplayer-dev-eng mailing | |
216 list, and if the code maintainers say OK, you may commit. This does not | |
217 apply to files you wrote and/or maintain. | |
218 | |
18841 | 219 |
13288 | 220 6. We refuse source indentation and other cosmetic changes if they are mixed |
221 with functional changes, such commits will be rejected and removed. Every | |
222 developer has his own indentation style, you should not change it. Of course | |
223 if you (re)write something, you can use your own style... (Many projects | |
224 force a given indentation style - we don't.) If you really need to make | |
225 indentation changes (try to avoid this), separate them strictly from real | |
226 changes. | |
12024 | 227 |
228 NOTE: If you had to put if(){ .. } over a large (> 5 lines) chunk of code, | |
13288 | 229 do NOT change the indentation of the inner part (don't move it to the right)! |
2200 | 230 |
18841 | 231 |
13288 | 232 7. Always fill out the commit log message. Describe in a few lines what you |
233 changed and why. You can refer to mailing list postings if you fix a | |
234 particular bug. Comments such as "fixed!" or "Changed it." are unacceptable. | |
2200 | 235 |
18841 | 236 |
13288 | 237 8. If you apply a patch by someone else, include the name and email address in |
18660 | 238 the log message. Since the mplayer-cvslog mailing list is publicly |
13288 | 239 archived you should add some spam protection to the email address. Send an |
240 answer to mplayer-dev-eng (or wherever you got the patch from) saying that | |
17054 | 241 you applied the patch. If the patch contains a documentation change, commit |
242 that as well; do not leave it to the documentation maintainers. | |
2200 | 243 |
18841 | 244 |
13288 | 245 9. Do NOT commit to code actively maintained by others without permission. Send |
246 a patch to mplayer-dev-eng instead. | |
12107
bc89ddda34b8
Developers should subscribe to mplayer-cvslog, mention mplayer-docs.
diego
parents:
12099
diff
changeset
|
247 |
18841 | 248 |
18660 | 249 10. Subscribe to the mplayer-cvslog mailing list. The diffs of all commits |
12107
bc89ddda34b8
Developers should subscribe to mplayer-cvslog, mention mplayer-docs.
diego
parents:
12099
diff
changeset
|
250 are sent there and reviewed by all the other developers. Bugs and possible |
bc89ddda34b8
Developers should subscribe to mplayer-cvslog, mention mplayer-docs.
diego
parents:
12099
diff
changeset
|
251 improvements or general questions regarding commits are discussed there. We |
bc89ddda34b8
Developers should subscribe to mplayer-cvslog, mention mplayer-docs.
diego
parents:
12099
diff
changeset
|
252 expect you to react if problems with your code are uncovered. |
12024 | 253 |
18841 | 254 |
13288 | 255 11. Update the documentation if you change behavior or add features. If you are |
256 unsure how best to do this, send a patch to mplayer-docs, the documentation | |
257 maintainers will review and commit your stuff. | |
258 | |
18841 | 259 |
12099 | 260 Also read DOCS/tech/patches.txt !!!! |
5415 | 261 |
7904
98168d30f67d
Spellchecked, reworded, reformatted, small additions and corrections.
diego
parents:
5415
diff
changeset
|
262 We think our rules are not too hard. If you have comments, contact us. |
98168d30f67d
Spellchecked, reworded, reformatted, small additions and corrections.
diego
parents:
5415
diff
changeset
|
263 |
98168d30f67d
Spellchecked, reworded, reformatted, small additions and corrections.
diego
parents:
5415
diff
changeset
|
264 |
3258 | 265 |
18827 | 266 III. Beginners Guide |
3258 | 267 ==================== |
18828 | 268 |
269 The typical flow of development would be: | |
270 | |
271 1. Check out the source: | |
272 | |
273 svn checkout svn://svn.mplayerhq.hu/mplayer/trunk/ devel | |
274 | |
18841 | 275 |
18828 | 276 2. Make your changes. |
277 | |
18841 | 278 |
18828 | 279 3. Create a patch: |
280 | |
18840 | 281 Run 'svn diff' from the root of the source tree, like this: |
18828 | 282 |
283 cd devel | |
284 svn diff > ../my_changes.patch | |
285 | |
286 If you have made several changes, but only want to submit one for review | |
287 by other developers, you can specify the filename(s), for example: | |
288 | |
289 svn diff mplayer.c > ../major_cleanup.patch | |
290 | |
18841 | 291 |
18828 | 292 4. Check the patch: |
293 | |
294 Check out another, clean source tree and verify your patch: | |
295 | |
296 svn checkout svn://svn.mplayerhq.hu/mplayer/trunk/ clean | |
297 cd clean | |
298 patch -p0 --dry-run < ../my_changes.patch | |
299 | |
300 If there are no errors, you can apply your patch: | |
301 | |
302 patch -p0 < ../my_changes.patch | |
303 | |
304 After that, verify that MPlayer still builds correctly with your patch | |
305 applied. Also, be sure that your patch meets our policy as described in | |
306 section II, specifically rules 1 to 6, before you continue submitting | |
307 the patch. | |
308 | |
18841 | 309 |
18828 | 310 5. Submit the patch: |
311 | |
312 Send an e-mail to the mplayer-dev-eng mailing list. Describe what your | |
313 patch does and why, and attach the patch file for review by others. | |
314 | |
18841 | 315 |
18828 | 316 6. During the review process, incorporate all suggested fixes. Go to step 2 |
317 repeatedly until there is nothing more to do for step 6. Of course, if | |
318 you don't agree with certain suggestions, things can be discussed on | |
319 the mailing list in a polite manner. | |
320 | |
18841 | 321 |
18828 | 322 7. Commit the patch: |
323 | |
324 If your patch is accepted, double check if your source tree contains the | |
18840 | 325 most recent version of your patch with 'svn diff'! After verifying that |
326 you met these conditions, commit with: | |
18828 | 327 |
18840 | 328 svn commit <filename(s)> |
18828 | 329 |
330 Go to step 2 ad infinitum until MPlayer is the perfect media player ;) | |
331 | |
18841 | 332 |
18828 | 333 Note: If you are listed as the maintainer for a particular piece of code, |
334 you can skip step 5 and 6 if your patch _only_ applies to the code you | |
335 maintain. If it touches other code or is otherwise very intrusive, please | |
336 post it to mplayer-dev-eng first. |