1 | $Id: README.developer 1637 2023-03-30 04:30:55Z peter $ |
---|
2 | |
---|
3 | = Developer Information = |
---|
4 | |
---|
5 | This file contains developer specific information. |
---|
6 | |
---|
7 | |
---|
8 | === Coding style === |
---|
9 | |
---|
10 | Developers should follow the coding style outlined in the |
---|
11 | [http://cbbp.thep.lu.se/~jari/documents/c++_coding_guidelines/index.html C++ coding guidelines]. |
---|
12 | |
---|
13 | |
---|
14 | === Subversion usage === |
---|
15 | |
---|
16 | Commits should be minimalistic and the projects should always compile |
---|
17 | ('make' and 'make check') when someone makes a clean checkout. There is |
---|
18 | a short introduction to subversion and its usage available as |
---|
19 | [http://cbbp.thep.lu.se/~jari/documents/subversion_guidelines/index.html Subversion guidelines]. |
---|
20 | We follow these guidelines. |
---|
21 | |
---|
22 | |
---|
23 | === Requirements === |
---|
24 | |
---|
25 | To build from a subversion checkout, you will need Autotools. More |
---|
26 | specifically Automake 1.11 (or later) and Autoconf 2.63 (or later). To |
---|
27 | build man page you will need help2man. |
---|
28 | |
---|
29 | === bootstrap and autoreconf === |
---|
30 | |
---|
31 | At first checkout from the repository you must run the bootstrapping |
---|
32 | utility |
---|
33 | |
---|
34 | #> ./bootstrap |
---|
35 | |
---|
36 | |
---|
37 | === configure === |
---|
38 | |
---|
39 | Run the generated configure script with |
---|
40 | |
---|
41 | #> ./configure --enable-debug |
---|
42 | |
---|
43 | The option flag '--enable-debug' turns on some compiler options |
---|
44 | appropriate for development (e.g. enables assertions). |
---|
45 | |
---|
46 | |
---|
47 | === Testing === |
---|
48 | |
---|
49 | Test programs should be created and added to the 'make check' |
---|
50 | execution. Always check that the test runs before committing code to |
---|
51 | the repository, i.e., run 'make check'. For more details on how to run |
---|
52 | and write tests, please refer to file 'test/README'. |
---|
53 | |
---|
54 | There is a test repository in 'test/repo' that is a part of |
---|
55 | the svndigest repository. The logic behind this is that it is nice to |
---|
56 | have a common test repository that can be used off-line. Changes to |
---|
57 | the repository are usually made to create new test cases and it is |
---|
58 | important that these changes are committed to svndigest repository as |
---|
59 | well. All changes to the test repository are not automatically |
---|
60 | propagated to the svndigest repository and it is important that some |
---|
61 | files created in the test repository are manually added to the |
---|
62 | svndigest repository. Assuming that 'make check' is run before a |
---|
63 | commit, a warning is generated if the test repository is inconsistent |
---|
64 | with the svndigest repository. There will be a diagnostic message and |
---|
65 | a resolution hint, however the developer must examine and resolve the |
---|
66 | problem manually. |
---|
67 | |
---|
68 | The problem is simply that the file 'test/repo/db/current' |
---|
69 | is changed compared to the svndigest repository. The 'current' file |
---|
70 | indicates a specific number of change sets within the test repository |
---|
71 | and the directories 'test/repo/db/revs' and |
---|
72 | 'test/repo/db/revprops' contains a matching number of |
---|
73 | change sets. However, the change sets added to the test repository are |
---|
74 | not automatically added to the svndigest repository, therefore the new |
---|
75 | files in the 'revs' and 'revprops' directories must be added manually |
---|
76 | to the svndigest repository. |
---|
77 | |
---|
78 | There is also a race condition when developers make changes to the |
---|
79 | test repository simultaneously: It is easy to create severe conflicts |
---|
80 | in the test repository. Imaging the case when two developers add test |
---|
81 | commits to the test repository, and then tries to add these to the |
---|
82 | svndigest repository. Since there are different versions of the same |
---|
83 | test repository revisions, the second developer committing to the |
---|
84 | svndigest will get messages about files being in the way. This is just |
---|
85 | one situation with possible conflicts. This conflict is of course |
---|
86 | resolved by the second developer having to throw away his changes and |
---|
87 | redo them after a new checkout of the test repository. |
---|
88 | |
---|
89 | The take home message is that developers should communicate with each |
---|
90 | other when changing the test repository in order to avoid to large |
---|
91 | repository conflicts. AND read the output of 'make check'. |
---|
92 | |
---|
93 | |
---|
94 | === yat library === |
---|
95 | |
---|
96 | Directory 'yat/' contains some files from the yat library. These |
---|
97 | files are not owned by svndigest and should not (if possible) be |
---|
98 | edited here. For more details please see 'yat/README'. |
---|
99 | |
---|
100 | === Output file structure === |
---|
101 | |
---|
102 | A directory reflecting the parsed directory is generated for each |
---|
103 | combination of StatsType, Author, and LineType, which is located in |
---|
104 | '<TARGET>/<ROOT>/StatsType/Author/LineType/'. Author may be, on top of |
---|
105 | each author in the repository, a directory 'all' that is a sum over |
---|
106 | all authors. In same fashion 'LineType' may be any of the three |
---|
107 | linetypes but may also be 'total', which is a sum over all |
---|
108 | linetypes. In each '<TARGET>/<ROOT>/StatsType' there are directories |
---|
109 | 'images/LineType' that contain a structure reflecting the parsed |
---|
110 | directory with images for every combination of 'File', 'LineType', and |
---|
111 | 'StatsType'. Images for different authors are identical and therefore |
---|
112 | shared between authors. |
---|
113 | |
---|
114 | == Design and Motivation == |
---|
115 | |
---|
116 | Please refer to 'doc/HACKING' for a list of design decisions we try to |
---|
117 | follow. |
---|
118 | |
---|
119 | = Releasing = |
---|
120 | |
---|
121 | The main development is performed in the trunk branch of the |
---|
122 | repository. A new release branch is created for each minor release |
---|
123 | from the trunk and patch releases are snapshots of the minor release |
---|
124 | branch. This implies that patch work is performed in the minor release |
---|
125 | branch, and changes made release branch is transferred to the trunk |
---|
126 | every time a new patch release is made. Remember, patch work should be |
---|
127 | limited to bug fixes and important fixes only leaving development of |
---|
128 | new features and designs to the trunk branch. |
---|
129 | |
---|
130 | Releases should only be performed by an appointed member of the team, |
---|
131 | the Release Manager. |
---|
132 | |
---|
133 | == Release procedure == |
---|
134 | |
---|
135 | This section describes what to do when publishing a release. |
---|
136 | |
---|
137 | === Creating a release branch === |
---|
138 | |
---|
139 | Once people agree that a new release branch should be made, the |
---|
140 | Release Manager creates it with the following procedure (substitute |
---|
141 | A.B with the version you are preparing): |
---|
142 | |
---|
143 | 1. Mark the new minor series in 'NEWS': |
---|
144 | |
---|
145 | 8<--- |
---|
146 | See the end for copyrights and conditions. |
---|
147 | |
---|
148 | +svndigest A.B.x series from |
---|
149 | + http://dev.thep/lu.se/svndigest/svn/branches/A.B-stable |
---|
150 | + |
---|
151 | Version A.B (released NOT YET) |
---|
152 | 8<--- |
---|
153 | |
---|
154 | commit the changes with |
---|
155 | |
---|
156 | #> svn ci -m "preparing branch A.B-stable" |
---|
157 | |
---|
158 | 2. Update copyright statements with commands |
---|
159 | |
---|
160 | #> make copyright |
---|
161 | |
---|
162 | Examine the updates and commit changes with |
---|
163 | |
---|
164 | #> svn ci -m "updating copyright statements" |
---|
165 | |
---|
166 | 3. Create a new minor branch using a one liner like |
---|
167 | |
---|
168 | #> make svn-stable-branch |
---|
169 | |
---|
170 | 4. Prepare the trunk for the next minor release: |
---|
171 | |
---|
172 | a) Update version number in 'm4/version.m4'. |
---|
173 | MY_VERSION_early([A], [B+1], [0], [true]) |
---|
174 | |
---|
175 | b) Add an entry in 'NEWS' |
---|
176 | |
---|
177 | version A.[B+1] (released NOT YET) |
---|
178 | |
---|
179 | The date is set when version A.[B+1] is released. |
---|
180 | |
---|
181 | c) Commit changes to the repository |
---|
182 | |
---|
183 | #> svn ci -m "Bumping VERSION to A.[B+1]" |
---|
184 | |
---|
185 | |
---|
186 | === Rolling a release === |
---|
187 | |
---|
188 | This section describes how to release a new version. If this is a |
---|
189 | minor release (C=0), replace A.B.C with A.B. Before you start, make |
---|
190 | sure you have write access to sourceforge page and that you can create |
---|
191 | checksum files, i.e., you need 'openssl' and 'md5'/'md5sum'. |
---|
192 | |
---|
193 | 1. Create a new milestone for next patch release A.B.[C+1]. |
---|
194 | |
---|
195 | 2. Update version number in 'm4/version.m4'. Locate and change the below line |
---|
196 | --- |
---|
197 | MY_VERSION_early([A], [B], [C], [false]) |
---|
198 | --- |
---|
199 | |
---|
200 | 3. Update file 'THANKS' |
---|
201 | |
---|
202 | 4. Make sure that the items in 'NEWS' cover the new features of the |
---|
203 | release. Set the date for the new release: |
---|
204 | |
---|
205 | version A.B.C (released 26 June 2007) |
---|
206 | |
---|
207 | 5. Commit changes to the repository |
---|
208 | |
---|
209 | #> svn ci -m "Preparing release A.B.C" |
---|
210 | |
---|
211 | 6. Update copyright statements with commands |
---|
212 | |
---|
213 | #> make && ./bin/svncopyright -v |
---|
214 | |
---|
215 | Examine the updates and commit changes with |
---|
216 | |
---|
217 | #> svn ci -m "updating copyright statements" |
---|
218 | |
---|
219 | 7. Issue 'svn update' to make entire wc to be in revision 'HEAD'. |
---|
220 | Needless to say, make sure that the program is in a state to be |
---|
221 | released; make sure that all the tests pass, test the distribution |
---|
222 | package, and perform all other release tests you think is |
---|
223 | appropriate. Run: |
---|
224 | |
---|
225 | #> make all && ./build_support/tag_and_release.sh |
---|
226 | |
---|
227 | |
---|
228 | 8. Update wiki first page under section 'Latest Release'. |
---|
229 | |
---|
230 | a) Update version to A.B.C. |
---|
231 | |
---|
232 | b) Update link to NEWS file to 'source:tags/A.B.C/NEWS' |
---|
233 | |
---|
234 | c) If this is a minor release (C=0) update links to |
---|
235 | 'source:branches/A.B-stable/doc/readme.txt', |
---|
236 | 'source:branches/A.B-stable/README'. |
---|
237 | |
---|
238 | 9. Update SubversionCheckout |
---|
239 | |
---|
240 | a) In section 'svndigest latest release' update link to |
---|
241 | [source:tags/A.B.C/NEWS NEWS] and modify the svn commands to |
---|
242 | |
---|
243 | svn checkout http://dev.thep.lu.se/svndigest/svn/tags/A.B.C svndigest-A.B.C |
---|
244 | |
---|
245 | svn switch http://dev.thep.lu.se/svndigest/svn/tags/A.B.C |
---|
246 | |
---|
247 | b) If this is a minor release (C=0) update link in 'svndigest stable' to |
---|
248 | [source:branch/A.B-stable/NEWS NEWS] and modify the svn commands to |
---|
249 | |
---|
250 | svn co http://dev.thep.lu.se/svndigest/svn/branches/A.B-stable svndigest-A.B |
---|
251 | |
---|
252 | svn switch ^/branches/A.B-stable |
---|
253 | |
---|
254 | 10. Add a version A.B.C using trac-admin tool |
---|
255 | |
---|
256 | 11. Close milestone A.B.C |
---|
257 | |
---|
258 | 12. Merge the release into trunk. Go to a pristine trunk WC and |
---|
259 | |
---|
260 | #> cd /path/to/svndigest-trunk |
---|
261 | #> svn update |
---|
262 | #> svn diff |
---|
263 | #> svn merge ^/branches/A.B-stable |
---|
264 | |
---|
265 | Resolve all conflicts. Run tests and perform all other appropriate |
---|
266 | tests to make sure that the merge does not create havoc. Typically |
---|
267 | changes in 'm4/version.m4' are problematic so check this file extra |
---|
268 | carefully. |
---|
269 | |
---|
270 | Commit changes to the trunk branch. |
---|
271 | |
---|
272 | #> svn commit -m "Merged release A.B.C to the trunk." |
---|
273 | |
---|
274 | 13. Prepare stable branch for future release |
---|
275 | |
---|
276 | a) Update version number in 'version.m4' in line |
---|
277 | |
---|
278 | MY_VERSION_early([A], [B], [C+1], [true]) |
---|
279 | |
---|
280 | b) Add an entry in 'NEWS' |
---|
281 | |
---|
282 | 8<--- |
---|
283 | version A.B.[C+1] (released NOT YET) |
---|
284 | 8<--- |
---|
285 | The date is set when version A.B.[C+1] is released. |
---|
286 | |
---|
287 | c) Commit changes to the repository, |
---|
288 | |
---|
289 | #> svn ci -m "Bumping version" |
---|
290 | |
---|
291 | 14. Send an announcement to svndigest-users@lists.sourceforge.net |
---|
292 | using 'announcement.txt' as template. |
---|
293 | |
---|
294 | 15. Create a macport ticket, https://trac.macports.org/newticket, with |
---|
295 | summary='svndigest A.B.C', |
---|
296 | type=update, |
---|
297 | keywords="haspatch maintainer", |
---|
298 | and port=svndigest. |
---|
299 | Attach 'Portfile.diff' to newly created ticket. |
---|
300 | |
---|
301 | |
---|
302 | -------------- |
---|
303 | Copyright (C) 2005, 2006 Jari Häkkinen |
---|
304 | Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson |
---|
305 | Copyright (C) 2009, 2012, 2015, 2023 Peter Johansson |
---|
306 | |
---|
307 | This file is part of svndigest, http://dev.thep.lu.se/svndigest |
---|
308 | |
---|
309 | svndigest is free software; you can redistribute it and/or modify it |
---|
310 | under the terms of the GNU General Public License as published by the |
---|
311 | Free Software Foundation; either version 3 of the License, or (at your |
---|
312 | option) any later version. |
---|
313 | |
---|
314 | svndigest is distributed in the hope that it will be useful, but |
---|
315 | WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
316 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
317 | General Public License for more details. |
---|
318 | |
---|
319 | You should have received a copy of the GNU General Public License |
---|
320 | along with svndigest. If not, see <http://www.gnu.org/licenses/>. |
---|