2200
|
1
|
|
2 About CVS write access: by A'rpi
|
|
3 ~~~~~~~~~~~~~~~~~~~~~~~
|
|
4
|
|
5 I. TECH SIDE:
|
|
6 =============
|
|
7 1. Changing password:
|
|
8
|
|
9 As you probably got a restricted CVS-only shell, it's not trivial:
|
|
10
|
|
11 ssh LOGIN@mplayerhq.hu passwd
|
|
12
|
|
13 (replace LOGIN with your loginname. leave 'passwd' unchanged, it's command)
|
|
14
|
|
15 Note: if you need real shell for something, tell me.
|
|
16
|
|
17 2. Checkout devel. source tree:
|
|
18
|
|
19 export CVS_RSH=ssh
|
|
20 cvs -z3 -d:ext:LOGIN@mplayerhq.hu:/cvsroot/mplayer co main
|
|
21
|
3149
|
22 NOTE: cvs -d:pserver: mode doesn't allow writting, even with password!
|
|
23
|
2200
|
24 3. Commiting changes:
|
|
25
|
|
26 cvs -z3 commit -m "comment - what and why did you change" filename(s)
|
|
27
|
3149
|
28 Do not use such comments: "bugfix." or "files changed" or "dunno"
|
|
29 You don't have to include filename in comment, as comments are linked
|
|
30 to files. If you have different comments for files, commit them separated,
|
|
31 not at same time.
|
|
32
|
2200
|
33 4. Adding new files/dirs:
|
|
34
|
|
35 cvs add filename/dirname
|
|
36
|
|
37 5. Removing files:
|
|
38
|
|
39 rm filename
|
|
40 cvs remove filename
|
5415
|
41 cvs commit -m "reason of removing this file" filename
|
2200
|
42
|
|
43 6. Check changes:
|
|
44
|
|
45 cvs -z3 diff -u filename(s)
|
|
46
|
3149
|
47 it's recommended to check changes first, before commit. especially if you
|
|
48 forget what did you change :)
|
|
49 and this way you will see if your patch has debug stuff or indenting change,
|
|
50 and you can fix it before commiting and triggering me to use cvs-backup.
|
|
51
|
2200
|
52 7. Check changelog:
|
|
53
|
|
54 cvs -z3 log filename(s)
|
|
55
|
5415
|
56 8. Rename/move files or content of files:
|
2200
|
57
|
3149
|
58 you can NOT do that. ask CVS server admin (A'rpi) to do it!
|
|
59 do NOT remove & re-add file - it will kill changelog!!!!
|
2200
|
60
|
5415
|
61 don't do big cut'n'paste from one file to another without very big
|
|
62 and already discussed and allowed (-dev-eng list) reason!
|
|
63 it will make those changes untrackable!
|
|
64
|
|
65 such actions are useless and treated as cosmetics in 99% of cases,
|
|
66 so try to avoid these.
|
|
67
|
|
68
|
2200
|
69 If you have any tech problems with cvs server, contact me:
|
|
70 A'rpi <arpi@thot.banki.hu>
|
|
71
|
|
72
|
|
73 II. POLICY / RULES:
|
|
74 ===================
|
|
75
|
|
76 1. You shouldn't commit code which makes cvs broken!
|
|
77 (i mean unfinished but enabled code which break
|
|
78 compiling or compiles but does not work)
|
|
79
|
|
80 2. You don't have over-test things. if it works for you,
|
|
81 and you think it should work for others too, then commit.
|
|
82 If it has problems (portability, exploits compiler bugs,
|
|
83 unusual environment etc) they will be reported, it's ok.
|
|
84
|
|
85 3. You can commit unfinished stuff (for testing etc), but it
|
|
86 must be disabled (#ifdef etc) by default.
|
|
87
|
|
88 4. Do not change behaviour of the program (renaming options etc)
|
|
89 without discussing first at the MPlayer-dev-eng list.
|
5415
|
90 Do not decrease/remove functionality of code. Just improve!
|
2200
|
91
|
|
92 5. Source indenting and other cosmetical changes are refused.
|
|
93 I'll remove those commits...
|
|
94 Every developer has its own indenting style, you shouldn't
|
|
95 change it. Of course if you (re)write something then you can
|
|
96 use your own style...
|
|
97 (Many projects forces a given indenting style - we don't)
|
5415
|
98
|
|
99 Note: if you had to put if(){ .. } over big (> 5 lines) code,
|
|
100 do NOT change the indent of the inner part (move it right) !
|
2200
|
101
|
|
102 6. Always fill out the comment at commiting (-m switch of cvs, or
|
|
103 in the editor if you left -m).
|
|
104 It shouldn't be such lines: "fixed!" or "Changed it."
|
|
105 Describe in a few lines (usually 1 line is enough) what did
|
5415
|
106 you changed and why did you do that. You can refer mails if bugfix.
|
2200
|
107
|
|
108 7. If you apply patch by someone else, include his name and email
|
5415
|
109 address in the cvs comment! Do NOT commit patches for other
|
|
110 developer's code (code not maintained by you) without his
|
|
111 permission! If he didn't commited - he probably has the reason!
|
2200
|
112
|
|
113 8. I've developed something called CVS-Backup. It archives CVS
|
|
114 repository after each commit - so I can reverse your commits
|
|
115 (without messing up changelog) if they are bad.
|
3149
|
116 If you think your bugfix or other change was bad and unneeded,
|
|
117 ask me to reverse it instead of commiting previous version!
|
4410
|
118
|
|
119 9. You won't have write access to DOCS/. (you have to its subdirs).
|
|
120 It was changed to avoid breaking docs or getting translations
|
|
121 or homepage desynced. Send your DOCS patch to Gabucino, he'll
|
5415
|
122 review, and commit (or not. probably not. never...).
|
2200
|
123
|
5415
|
124 Also read patches.txt !!!!
|
|
125
|
2200
|
126 I think our rules aren't too hard. If you have comments, contact me.
|
3258
|
127
|
|
128 III. Beginners Guide by David Holm
|
|
129 ====================
|
|
130 When I first got CVS write access I got banned after only a few hours
|
|
131 because I didn't fully understand this documentation. This part is for
|
|
132 those of you who have just got cvs write access and want to avoid the
|
|
133 most common pitfalls leading to cvs ban.
|
|
134 I will introduce a step-by-step guide explaining how I'm making sure
|
|
135 that my cvs commits are proper and won't get me banned.
|
|
136
|
|
137 1. You should set up two dirs for mplayer, one which contains the stable
|
|
138 version and has the :ext: option instead of :pserver: in CVS/Root.
|
|
139 The other should be your development dir and have the CVS/Root set to
|
|
140 :pserver: instead of :ext:, that way you can't commit development code
|
|
141 by accident (since only :ext: allows writes).
|
|
142 This is my setup:
|
|
143 ~/mplayer
|
|
144 /main
|
|
145 /main.dev
|
|
146 NOTE: I'll use these dir names from hereon in the guide, what you want
|
|
147 to call your dirs are entirely up to you. This is _only_ an example.
|
|
148
|
|
149 2. When you are satisfied with the changes in "main.dev" and think you are
|
|
150 ready to commit the changes to CVS start by doing the following in the
|
|
151 "~/mplayer" dir":
|
|
152 diff -Nur -x "CVS" -x ".*" main main.dev > dev2stable
|
|
153 dev2stable is the filename for the patchfile, it doesn't matter what you
|
|
154 call it.
|
|
155
|
|
156 3. Now comes one of the tricky parts, editing the patch.
|
|
157 I prefer using mcedit (comes with Midnight Commander) since it does syntax
|
|
158 highlighting in patches (= it uses colors to identify lines =), But most
|
|
159 ascii editors should do (meaning don't use staroffice and save it as a
|
|
160 star office document for instance ;)
|
|
161 I will try to explain this as good as I can.
|
|
162 Read throught the patch and remove all occurances of:
|
|
163 * diff -Nur.... that are affecting files YOU have NOT modified
|
|
164 these occur when either main or main.dev are different version
|
|
165 (not checked out at the same time)
|
|
166 EVERYTHING from the diff -Nur... line until the next diff -Nur...
|
|
167 line are changes to the file specified after the diff options,
|
|
168 and ONLY that file.
|
|
169
|
|
170 * Lines containing "Binary files..." if you add the 'a' switch to
|
|
171 -N(a)ur binary files will be added to the patch as well, making it
|
|
172 huge and puts alot of unnecessary data in it (since you seldom
|
|
173 commit any binaries).
|
|
174
|
|
175 * If you find changes within a diff block that you don't want to
|
|
176 commit you can delete them if they are the only changes ranging
|
|
177 from the @@ -x,y +x,y @@ until the line before the next
|
|
178 @@ -x,y +x,y @@. You _cannot_ remove single lines after a
|
|
179 @@ -x,y +x,y @@ because that will break the patch!.
|
|
180 example:
|
|
181 ...
|
|
182 @@ -15,34 +15,6 @@
|
|
183 - old_option;
|
|
184 + new_option;
|
|
185 @@ -65,13 +65,3 @@
|
|
186 ...
|
|
187
|
|
188 Ok:
|
|
189 ...
|
|
190 @@ -65,13 +65,3 @@
|
|
191 ...
|
|
192
|
|
193 Will break patch:
|
|
194 ...
|
|
195 @@ -15,34 +15,6 @@
|
|
196 old_option;
|
|
197 @@ -65,13 +65,3 @@
|
|
198 ...
|
|
199
|
|
200 When I end up in situation where I have to remove just smoe lines from
|
|
201 a block I leave it alone, remember (write down) which file it is in and
|
|
202 then edit the file in "main" after I've applied the patch.
|
|
203
|
|
204 * Now it's time for applying the patch to the "main" (stable) dir. This
|
|
205 should be done in two steps:
|
|
206 1. enter "main" and run "patch -p1 --dry-run < ../dev2stable"
|
|
207 -p1 means that you are one level deep (that you have entered
|
|
208 the "main" directory and that should be stripped when patching,
|
|
209 if you run it from "~/mplayer" you would use -p0).
|
|
210 --dry-run means that patch does everything it normally does
|
|
211 but without modifying ANY files, this is a great way of testing
|
|
212 whether your patch works or not.
|
|
213 "../dev2stable" is your patchfile. (don't forget the '<')
|
|
214 If the dry run fails check the line it failed on and figure out
|
|
215 why it failed, make a new patch, and try again.
|
|
216 2. Ok, you finally have a working patch, remove --dry-run and patch
|
|
217 "main" and you are done with the patching part =).
|
|
218
|
|
219 4. It's almost time for the final step, commiting the changes. But first you MUST make
|
|
220 sure your changes compiles without breaking anything and that it follows the Policy
|
|
221 mentioned in section 2. (Read it until your eyes are bleeding if you want to keep CVS
|
|
222 access!)
|
|
223 Don't worry about object files etc that will be created in your "main" dir, they won't
|
|
224 be sent to CVS on commit, you must use the add command to add new files (discuss it on
|
|
225 the list before adding new files!).
|
|
226 Now to make sure your additions follow policy do the following on every file you will
|
|
227 commit:
|
|
228 "cvs -z3 diff -u <filename> > <filename.d> of course the output file (<filename.d>) can
|
|
229 have any name you want. This will create a file showing the differences between the
|
|
230 file on cvs and your updated local file.
|
|
231 I will explain some of the policy rules I had a hard time understanding:
|
|
232 5. This means that if for instance you have lines in <filename.d> that look
|
|
233 something like this:
|
|
234 -
|
|
235 +
|
|
236 That means that you have either added or removed a tab or spaces on that line.
|
|
237 That qualifies as cosmetical changes and is disallowed. Edit the file and put
|
|
238 back/remove the added/removed tab/spaces.
|
|
239 Do a new diff on the file and make sure it fixed the cosmetics.
|
|
240 6. Make sure you read and understand this properly before commiting anything. Commit
|
|
241 one file at a time!
|
|
242
|
|
243 5. Ok, you have a working patch following the cvs policy, excellent work. Now for the
|
|
244 final step, commiting. This is real simple. Just run the following command in "main"
|
|
245 for each file you want to commit:
|
|
246 "cvs -z3 commit -m "<comment (changes)>" <filename>" or
|
|
247 "cvs -z3 commit <filename>"
|
|
248 The latter will bring up your default text editor for writing comments (I prefer this
|
|
249 method).
|
|
250
|
|
251 You are done, congratulations. If you are certain you have followed all the policies you
|
|
252 shouldn't have any troubles with CVS maintainers at all.
|
|
253 At first I thought the policy was too strict, I discussed it with Arpi and he made some
|
|
254 very good points, so don't complain.
|