[84] | 1 | $Id: README.developer 560 2008-03-04 18:06:21Z peter $ |
---|
[26] | 2 | |
---|
[338] | 3 | = Developer Information = |
---|
| 4 | |
---|
| 5 | This file contains developer specific information. |
---|
| 6 | |
---|
[394] | 7 | |
---|
| 8 | === Coding style === |
---|
| 9 | |
---|
| 10 | Developers should follow the coding style outlined in the |
---|
[560] | 11 | [http://cbbp.thep.lu.se/~jari/documents/c++_coding_guidelines/index.html C++ coding guidelines]. |
---|
[394] | 12 | |
---|
| 13 | |
---|
| 14 | === Subversion usage === |
---|
| 15 | |
---|
| 16 | Commits should be minimalistic and the projects should always compile |
---|
[442] | 17 | (`make` and `make check`) when someone makes a clean checkout. There is |
---|
[394] | 18 | a short introduction to subversion and its usage available as |
---|
[560] | 19 | [http://cbbp.thep.lu.se/~jari/documents/subversion_guidelines/index.html Subversion guidelines]. |
---|
[394] | 20 | We follow these guidelines. |
---|
| 21 | |
---|
| 22 | |
---|
[481] | 23 | === bootstrap and autoreconf === |
---|
[387] | 24 | |
---|
[481] | 25 | At first checkout from the repository you must run the bootstrapping |
---|
| 26 | utility |
---|
[338] | 27 | |
---|
| 28 | `./bootstrap` |
---|
| 29 | |
---|
[481] | 30 | to setup autoconf files. To push subsequent changes of this file into |
---|
| 31 | the build scripts you run |
---|
[338] | 32 | |
---|
[481] | 33 | `autoreconf` |
---|
[394] | 34 | |
---|
[481] | 35 | |
---|
[338] | 36 | === configure === |
---|
| 37 | |
---|
[387] | 38 | Run the generated configure script with |
---|
| 39 | |
---|
[555] | 40 | `./configure --enable-debug` |
---|
[338] | 41 | |
---|
| 42 | The option flag `--enable-debug` turns on debug options (e.g. enables |
---|
[547] | 43 | assertions). |
---|
[338] | 44 | |
---|
[394] | 45 | |
---|
| 46 | === Testing === |
---|
| 47 | |
---|
| 48 | Test programs should be created and added to the `make check` |
---|
| 49 | execution. Always check that the test runs before committing code to |
---|
| 50 | the repository, i.e., run `make check`. |
---|
| 51 | |
---|
| 52 | There is a test repository in source:trunk/test/repo that is a part of |
---|
| 53 | the svndigest repository. The logic behind this is that it is nice to |
---|
| 54 | have a common test repository that can be used off-line. Changes to |
---|
| 55 | the repository are usually made to create new test cases and it is |
---|
| 56 | important that these changes are committed to svndigest repository as |
---|
| 57 | well. All changes to the test repository are not automatically |
---|
| 58 | propagated to the svndigest repository and it is important that some |
---|
| 59 | files created in the test repository are manually added to the |
---|
| 60 | svndigest repository. Assuming that `make check` is run before a |
---|
| 61 | commit, a warning is generated if the test repository is inconsistent |
---|
| 62 | with the svndigest repository. There will be a diagnostic message and |
---|
| 63 | a resolution hint, however the developer must examine and resolve the |
---|
| 64 | problem manually. |
---|
| 65 | |
---|
| 66 | The problem is simply that the file source:trunk/test/repo/db/current |
---|
| 67 | is changed compared to the svndigest repository. The `current` file |
---|
| 68 | indicates a specific number of change sets within the test repository |
---|
| 69 | and the directories source:trunk/test/repo/db/revs and |
---|
| 70 | source:trunk/test/repo/db/revprops contains a matching number of |
---|
| 71 | change sets. However, the change sets added to the test repository are |
---|
| 72 | not automatically added to the svndigest repository, therefore the new |
---|
| 73 | files in the `revs` and `revprops` directories must be added manually |
---|
| 74 | to the svndigest repository. |
---|
| 75 | |
---|
| 76 | There is also a race condition when developers make changes to the |
---|
| 77 | test repository simultaneously: It is easy to create severe conflicts |
---|
| 78 | in the test repository. Imaging the case when two developers adds test |
---|
| 79 | commits to the test repository, and then tries to add these to the |
---|
| 80 | svndigest repository. Since there are different versions of the same |
---|
| 81 | test repository revisions, the second developer committing to the |
---|
| 82 | svndigest will get messages about files being in the way. This is just |
---|
| 83 | one situation with possible conflicts. This conflict is of course |
---|
| 84 | resolved by the second developer having to throw away his changes and |
---|
| 85 | redo them after a new checkout of the test repository. |
---|
| 86 | |
---|
| 87 | The take home message is that developers should communicate with each |
---|
| 88 | other when changing the test repository in order to avoid to large |
---|
| 89 | repository conflicts. AND read the output of `make check`. |
---|
| 90 | |
---|
| 91 | |
---|
[494] | 92 | === Output file structure === |
---|
| 93 | |
---|
| 94 | A directory reflecting the parsed directory is generated for each |
---|
| 95 | combination of StatsType, Author, and LineType, which is located in |
---|
[496] | 96 | `<TARGET>/<ROOT>/StatsType/Author/LineType/`. Author may be, on top of |
---|
| 97 | each author in the repository, a directory ''all'' that is a sum over |
---|
| 98 | all Authors. In same fashion LineType may be any of the three |
---|
| 99 | linetypes but may also ''total'', which a sum over all linetypes. In |
---|
| 100 | each `<TARGET>/<ROOT>/StatsType` there are directories |
---|
| 101 | `images/LineType` that contain a structure reflecting the parsed |
---|
| 102 | directory with images for every combination of File, LineType, and |
---|
| 103 | StatsType. Images for different Authors are identical and therefore |
---|
| 104 | shared between authors. |
---|
[494] | 105 | |
---|
| 106 | |
---|
[338] | 107 | === Create a distribution === |
---|
[387] | 108 | |
---|
[338] | 109 | Create a distribution package with `make dist`. Remember to test |
---|
| 110 | the package with `make distcheck`. If required packages are installed |
---|
| 111 | in non-standard locations you need to pass this information to |
---|
| 112 | `distcheck`. This is done by using the variable |
---|
| 113 | DISTCHECK_CONFIGURE_FLAGS as |
---|
| 114 | |
---|
[499] | 115 | `DISTCHECK_CONFIGURE_FLAGS="[OPTION]..." make distcheck` |
---|
[338] | 116 | |
---|
| 117 | Usually you need to set DISTCHECK_CONFIGURE_FLAGS to whatever options |
---|
[555] | 118 | you pass to configure. |
---|
[338] | 119 | |
---|
| 120 | |
---|
[394] | 121 | == Releasing == |
---|
[338] | 122 | |
---|
[519] | 123 | See http://trac.thep.lu.se/svndigest/wiki/ReleaseProcedure |
---|
[394] | 124 | |
---|
| 125 | |
---|
[338] | 126 | ------------------------------------------------------------------------- |
---|
| 127 | {{{ |
---|
[408] | 128 | Copyright (C) 2005, 2006 Jari Häkkinen |
---|
[394] | 129 | Copyright (C) 2007 Jari Häkkinen, Peter Johansson |
---|
[547] | 130 | Copyright (C) 2008 Peter Johansson |
---|
[84] | 131 | |
---|
[519] | 132 | This file is part of svndigest, http://trac.thep.lu.se/svndigest |
---|
[84] | 133 | |
---|
[149] | 134 | svndigest is free software; you can redistribute it and/or modify it |
---|
[84] | 135 | under the terms of the GNU General Public License as published by the |
---|
| 136 | Free Software Foundation; either version 2 of the License, or (at your |
---|
| 137 | option) any later version. |
---|
| 138 | |
---|
[149] | 139 | svndigest is distributed in the hope that it will be useful, but |
---|
| 140 | WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 141 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
| 142 | General Public License for more details. |
---|
[84] | 143 | |
---|
| 144 | You should have received a copy of the GNU General Public License |
---|
| 145 | along with this program; if not, write to the Free Software |
---|
| 146 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
---|
| 147 | USA. |
---|
| 148 | |
---|
[338] | 149 | }}} |
---|