gdt | d9fd04c | 2003-12-19 19:20:25 +0000 | [diff] [blame] | 1 | -*- mode: text; -*- |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 2 | $QuaggaId: Format:%an, %ai, %h$ $ |
| 3 | |
| 4 | Contents: |
| 5 | |
| 6 | * GUIDELINES FOR HACKING ON QUAGGA |
| 7 | * COMPILE-TIME CONDITIONAL CODE |
| 8 | * COMMIT MESSAGE |
| 9 | * HACKING THE BUILD SYSTEM |
| 10 | * RELEASE PROCEDURE |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 11 | * TOOL VERSIONS |
| 12 | * SHARED LIBRARY VERSIONING |
Paul Jakma | 724b3ae | 2012-03-07 11:02:05 +0000 | [diff] [blame^] | 13 | * GIT COMMIT SUBSMISSION |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 14 | * PATCH SUBMISSION |
| 15 | * PATCH APPLICATION |
| 16 | * STABLE PLATFORMS AND DAEMONS |
| 17 | * IMPORT OR UPDATE VENDOR SPECIFIC ROUTING PROTOCOLS |
gdt | d9fd04c | 2003-12-19 19:20:25 +0000 | [diff] [blame] | 18 | |
Greg Troxel | a8e474a | 2010-11-03 07:22:00 -0400 | [diff] [blame] | 19 | |
gdt | d9fd04c | 2003-12-19 19:20:25 +0000 | [diff] [blame] | 20 | GUIDELINES FOR HACKING ON QUAGGA |
| 21 | |
gdt | d9fd04c | 2003-12-19 19:20:25 +0000 | [diff] [blame] | 22 | [this is a draft in progress] |
| 23 | |
hasso | 863076d | 2004-09-01 20:13:23 +0000 | [diff] [blame] | 24 | GNU coding standards apply. Indentation follows the result of |
| 25 | invoking GNU indent (as of 2.2.8a) with no arguments. Note that this |
| 26 | uses tabs instead of spaces where possible for leading whitespace, and |
| 27 | assumes that tabs are every 8 columns. Do not attempt to redefine the |
| 28 | location of tab stops. Note also that some indentation does not |
| 29 | follow GNU style. This is a historical accident, and we generally |
| 30 | only clean up whitespace when code is unmaintainable due to whitespace |
Paul Jakma | 724b3ae | 2012-03-07 11:02:05 +0000 | [diff] [blame^] | 31 | issues, to minimise merging conflicts. |
hasso | 863076d | 2004-09-01 20:13:23 +0000 | [diff] [blame] | 32 | |
| 33 | For GNU emacs, use indentation style "gnu". |
| 34 | |
| 35 | For Vim, use the following lines (note that tabs are at 8, and that |
| 36 | softtabstop sets the indentation level): |
| 37 | |
| 38 | set tabstop=8 |
| 39 | set softtabstop=2 |
| 40 | set shiftwidth=2 |
| 41 | set noexpandtab |
gdt | d9fd04c | 2003-12-19 19:20:25 +0000 | [diff] [blame] | 42 | |
gdt | 2934f28 | 2004-01-05 20:09:00 +0000 | [diff] [blame] | 43 | Be particularly careful not to break platforms/protocols that you |
| 44 | cannot test. |
| 45 | |
Paul Jakma | 724b3ae | 2012-03-07 11:02:05 +0000 | [diff] [blame^] | 46 | New code should have good comments, which explain why the code is correct. |
| 47 | Changes to existing code should in many cases upgrade the comments when |
| 48 | necessary for a reviewer to conclude that the change has no unintended |
| 49 | consequences. |
gdt | 2934f28 | 2004-01-05 20:09:00 +0000 | [diff] [blame] | 50 | |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 51 | Each file in the Git repository should have a git format-placeholder (like |
| 52 | an RCS Id keyword), somewhere very near the top, commented out appropriately |
| 53 | for the file type. The placeholder used for Quagga (replacing <dollar> with |
| 54 | $) is: |
| 55 | |
| 56 | $QuaggaId: <dollar>Format:%an, %ai, %h<dollar> $ |
| 57 | |
| 58 | See line 2 of HACKING for an example; |
| 59 | |
| 60 | This placeholder string will be expanded out by the 'git archive' commands, |
| 61 | wihch is used to generate the tar archives for snapshots and releases. |
gdt | 697877e | 2004-11-15 19:23:47 +0000 | [diff] [blame] | 62 | |
ajs | 5e76477 | 2004-12-03 19:03:33 +0000 | [diff] [blame] | 63 | Please document fully the proper use of a new function in the header file |
| 64 | in which it is declared. And please consult existing headers for |
| 65 | documentation on how to use existing functions. In particular, please consult |
| 66 | these header files: |
| 67 | |
| 68 | lib/log.h logging levels and usage guidance |
| 69 | [more to be added] |
| 70 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 71 | If changing an exported interface, please try to deprecate the interface in |
| 72 | an orderly manner. If at all possible, try to retain the old deprecated |
| 73 | interface as is, or functionally equivalent. Make a note of when the |
| 74 | interface was deprecated and guard the deprecated interface definitions in |
| 75 | the header file, ie: |
| 76 | |
| 77 | /* Deprecated: 20050406 */ |
| 78 | #if !defined(QUAGGA_NO_DEPRECATED_INTERFACES) |
| 79 | #warning "Using deprecated <libname> (interface(s)|function(s))" |
| 80 | ... |
| 81 | #endif /* QUAGGA_NO_DEPRECATED_INTERFACES */ |
| 82 | |
| 83 | To ensure that the core Quagga sources do not use the deprecated interfaces |
| 84 | (you should update Quagga sources to use new interfaces, if applicable) |
| 85 | while allowing external sources to continue to build. Deprecated interfaces |
| 86 | should be excised in the next unstable cycle. |
| 87 | |
paul | 74a2dd7 | 2005-04-25 00:37:03 +0000 | [diff] [blame] | 88 | Note: If you wish, you can test for GCC and use a function |
| 89 | marked with the 'deprecated' attribute. However, you must provide the |
| 90 | #warning for other compilers. |
| 91 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 92 | If changing or removing a command definition, *ensure* that you properly |
| 93 | deprecate it - use the _DEPRECATED form of the appropriate DEFUN macro. This |
| 94 | is *critical*. Even if the command can no longer function, you *must* still |
| 95 | implement it as a do-nothing stub. Failure to follow this causes grief for |
| 96 | systems administrators. Deprecated commands should be excised in the next |
| 97 | unstable cycle. A list of deprecated commands should be collated for each |
| 98 | release. |
| 99 | |
| 100 | See also below regarding SHARED LIBRARY VERSIONING. |
ajs | 5e76477 | 2004-12-03 19:03:33 +0000 | [diff] [blame] | 101 | |
Greg Troxel | a8e474a | 2010-11-03 07:22:00 -0400 | [diff] [blame] | 102 | |
Paul Jakma | 750e814 | 2008-07-22 21:11:48 +0000 | [diff] [blame] | 103 | COMPILE-TIME CONDITIONAL CODE |
| 104 | |
| 105 | Please think very carefully before making code conditional at compile time, |
| 106 | as it increases maintenance burdens and user confusion. In particular, |
| 107 | please avoid gratuitious --enable-.... switches to the configure script - |
| 108 | typically code should be good enough to be in Quagga, or it shouldn't be |
| 109 | there at all. |
| 110 | |
| 111 | When code must be compile-time conditional, try have the compiler make it |
Paul Jakma | 724b3ae | 2012-03-07 11:02:05 +0000 | [diff] [blame^] | 112 | conditional rather than the C pre-processor - so that it will still be |
| 113 | checked by the compiler, even if disabled. I.e. this: |
Paul Jakma | 750e814 | 2008-07-22 21:11:48 +0000 | [diff] [blame] | 114 | |
| 115 | if (SOME_SYMBOL) |
| 116 | frobnicate(); |
| 117 | |
| 118 | rather than: |
| 119 | |
| 120 | #ifdef SOME_SYMBOL |
| 121 | frobnicate (); |
| 122 | #endif /* SOME_SYMBOL */ |
| 123 | |
| 124 | Note that the former approach requires ensuring that SOME_SYMBOL will be |
| 125 | defined (watch your AC_DEFINEs). |
paul | 74a2dd7 | 2005-04-25 00:37:03 +0000 | [diff] [blame] | 126 | |
Greg Troxel | a8e474a | 2010-11-03 07:22:00 -0400 | [diff] [blame] | 127 | |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 128 | COMMIT MESSAGES |
gdt | 2934f28 | 2004-01-05 20:09:00 +0000 | [diff] [blame] | 129 | |
Paul Jakma | 724b3ae | 2012-03-07 11:02:05 +0000 | [diff] [blame^] | 130 | The commit message MUST provide: |
gdt | 2934f28 | 2004-01-05 20:09:00 +0000 | [diff] [blame] | 131 | |
Greg Troxel | d7a9779 | 2010-11-03 07:20:38 -0400 | [diff] [blame] | 132 | * A suitable one-line summary followed by a blank line as the very |
| 133 | first line of the message, in the form: |
gdt | 2934f28 | 2004-01-05 20:09:00 +0000 | [diff] [blame] | 134 | |
Paul Jakma | 3de4277 | 2009-07-28 16:04:35 +0100 | [diff] [blame] | 135 | topic: high-level, one line summary |
paul | ca6383b | 2005-11-10 10:21:19 +0000 | [diff] [blame] | 136 | |
Paul Jakma | 3de4277 | 2009-07-28 16:04:35 +0100 | [diff] [blame] | 137 | Where topic would tend to be name of a subdirectory, and/or daemon, unless |
| 138 | there's a more suitable topic (e.g. 'build'). This topic is used to |
| 139 | organise change summaries in release announcements. |
paul | ca6383b | 2005-11-10 10:21:19 +0000 | [diff] [blame] | 140 | |
Paul Jakma | 724b3ae | 2012-03-07 11:02:05 +0000 | [diff] [blame^] | 141 | The remainder of the commit message - its "body" - should ideally try to |
| 142 | address the following areas, so as to help reviewers and future browsers of |
| 143 | the code-base understand why the change is correct (note also the code |
| 144 | comment requirements): |
paul | ca6383b | 2005-11-10 10:21:19 +0000 | [diff] [blame] | 145 | |
Paul Jakma | 724b3ae | 2012-03-07 11:02:05 +0000 | [diff] [blame^] | 146 | * The motivation for the change (does it fix a bug, if so which? |
| 147 | add a feature?) |
| 148 | * The general approach taken, and trade-offs versus any other approaches. |
| 149 | * Any testing undertaken or other information affecting the confidence |
| 150 | that can be had in the change. |
| 151 | * Information to allow reviewers to be able to tell which specific changes |
| 152 | to the code are intended (and hence be able to spot any accidental |
| 153 | unintended changes). |
Paul Jakma | 3de4277 | 2009-07-28 16:04:35 +0100 | [diff] [blame] | 154 | |
Greg Troxel | d7a9779 | 2010-11-03 07:20:38 -0400 | [diff] [blame] | 155 | The one-line summary must be limited to 54 characters, and all other |
| 156 | lines to 72 characters. |
paul | ca6383b | 2005-11-10 10:21:19 +0000 | [diff] [blame] | 157 | |
Paul Jakma | 724b3ae | 2012-03-07 11:02:05 +0000 | [diff] [blame^] | 158 | Commit message bodies in the Quagga project have typically taken the |
| 159 | following form: |
Paul Jakma | 3de4277 | 2009-07-28 16:04:35 +0100 | [diff] [blame] | 160 | |
Paul Jakma | 724b3ae | 2012-03-07 11:02:05 +0000 | [diff] [blame^] | 161 | * An optional introduction, describing the change generally. |
| 162 | * A short description of each specific change made, preferably: |
| 163 | * file by file |
| 164 | * function by function (use of "ditto", or globs is allowed) |
| 165 | |
| 166 | Contributors are strongly encouraged to follow this form. |
| 167 | |
| 168 | This itemised commit messages allows reviewers to have confidence that the |
| 169 | author has self-reviewed every line of the patch, as well as providing |
| 170 | reviewers a clear index of which changes are intended, and descriptions for |
| 171 | them (C-to-english descriptions are not desireable - some discretion is |
| 172 | useful). For short patches, a per-function/file break-down may be |
| 173 | redundant. For longer patches, such a break-down may be essential. A |
| 174 | contrived example (where the general discussion is obviously somewhat |
| 175 | redundant, given the one-line summary): |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 176 | |
Paul Jakma | 3de4277 | 2009-07-28 16:04:35 +0100 | [diff] [blame] | 177 | zebra: Enhance frob FSM to detect loss of frob |
paul | ca6383b | 2005-11-10 10:21:19 +0000 | [diff] [blame] | 178 | |
Paul Jakma | 724b3ae | 2012-03-07 11:02:05 +0000 | [diff] [blame^] | 179 | Add a new DOWN state to the frob state machine to allow the barinator to |
| 180 | detect loss of frob. |
| 181 | |
Paul Jakma | 3de4277 | 2009-07-28 16:04:35 +0100 | [diff] [blame] | 182 | * frob.h: (struct frob) Add DOWN state flag. |
| 183 | * frob.c: (frob_change) set/clear DOWN appropriately on state change. |
| 184 | * bar.c: (barinate) Check frob for DOWN state. |
paul | 1f8f61a | 2004-11-05 23:38:20 +0000 | [diff] [blame] | 185 | |
Paul Jakma | 724b3ae | 2012-03-07 11:02:05 +0000 | [diff] [blame^] | 186 | Please have a look at the git commit logs to get a feel for what the norms |
| 187 | are. |
| 188 | |
Greg Troxel | d7a9779 | 2010-11-03 07:20:38 -0400 | [diff] [blame] | 189 | Note that the commit message format follows git norms, so that "git |
| 190 | log --oneline" will have useful output. |
paul | 74a2dd7 | 2005-04-25 00:37:03 +0000 | [diff] [blame] | 191 | |
| 192 | HACKING THE BUILD SYSTEM |
| 193 | |
| 194 | If you change or add to the build system (configure.ac, any Makefile.am, |
| 195 | etc.), try to check that the following things still work: |
| 196 | |
| 197 | - make dist |
| 198 | - resulting dist tarball builds |
Greg Troxel | a8e474a | 2010-11-03 07:22:00 -0400 | [diff] [blame] | 199 | - out-of-tree builds |
paul | 74a2dd7 | 2005-04-25 00:37:03 +0000 | [diff] [blame] | 200 | |
| 201 | The quagga.net site relies on make dist to work to generate snapshots. It |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 202 | must work. Common problems are to forget to have some additional file |
paul | 74a2dd7 | 2005-04-25 00:37:03 +0000 | [diff] [blame] | 203 | included in the dist, or to have a make rule refer to a source file without |
| 204 | using the srcdir variable. |
| 205 | |
Greg Troxel | a8e474a | 2010-11-03 07:22:00 -0400 | [diff] [blame] | 206 | |
gdt | 0d7e913 | 2005-02-23 16:20:07 +0000 | [diff] [blame] | 207 | RELEASE PROCEDURE |
| 208 | |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 209 | * Tag the apppropriate commit with a release tag (follow existing |
| 210 | conventions). |
gdt | 0d7e913 | 2005-02-23 16:20:07 +0000 | [diff] [blame] | 211 | [This enables recreating the release, and is just good CM practice.] |
| 212 | |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 213 | * Create a fresh tar archive of the quagga.net repository, and do a test |
| 214 | build: |
gdt | 0d7e913 | 2005-02-23 16:20:07 +0000 | [diff] [blame] | 215 | |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 216 | git-clone git:///code.quagga.net/quagga.git quagga |
| 217 | git-archive --remote=git://code.quagga.net/quagga.git \ |
| 218 | --prefix=quagga-release/ master | tar -xf - |
| 219 | cd quagga-release |
gdt | 0d7e913 | 2005-02-23 16:20:07 +0000 | [diff] [blame] | 220 | |
Paul Jakma | 3de4277 | 2009-07-28 16:04:35 +0100 | [diff] [blame] | 221 | autoreconf -i |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 222 | ./configure |
| 223 | make |
| 224 | make dist |
gdt | 0d7e913 | 2005-02-23 16:20:07 +0000 | [diff] [blame] | 225 | |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 226 | The tarball which 'make dist' creates is the tarball to be released! The |
| 227 | git-archive step ensures you're working with code corresponding to that in |
| 228 | the official repository, and also carries out keyword expansion. If any |
Greg Troxel | a8e474a | 2010-11-03 07:22:00 -0400 | [diff] [blame] | 229 | errors occur, move tags as needed and start over from the fresh checkouts. |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 230 | Do not append to tarballs, as this has produced non-standards-conforming |
| 231 | tarballs in the past. |
gdt | 0d7e913 | 2005-02-23 16:20:07 +0000 | [diff] [blame] | 232 | |
Paul Jakma | 3de4277 | 2009-07-28 16:04:35 +0100 | [diff] [blame] | 233 | See also: http://wiki.quagga.net/index.php/Main/Processes |
| 234 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 235 | [TODO: collation of a list of deprecated commands. Possibly can be scripted |
| 236 | to extract from vtysh/vtysh_cmd.c] |
| 237 | |
paul | 74a2dd7 | 2005-04-25 00:37:03 +0000 | [diff] [blame] | 238 | |
gdt | fbb6709 | 2004-11-15 17:29:11 +0000 | [diff] [blame] | 239 | TOOL VERSIONS |
| 240 | |
| 241 | Require versions of support tools are listed in INSTALL.quagga.txt. |
| 242 | Required versions should only be done with due deliberation, as it can |
| 243 | cause environments to no longer be able to compile quagga. |
| 244 | |
paul | 74a2dd7 | 2005-04-25 00:37:03 +0000 | [diff] [blame] | 245 | |
gdt | b7a97f8 | 2004-07-23 16:23:56 +0000 | [diff] [blame] | 246 | SHARED LIBRARY VERSIONING |
| 247 | |
| 248 | [this section is at the moment just gdt's opinion] |
| 249 | |
| 250 | Quagga builds several shared libaries (lib/libzebra, ospfd/libospf, |
| 251 | ospfclient/libsopfapiclient). These may be used by external programs, |
| 252 | e.g. a new routing protocol that works with the zebra daemon, or |
| 253 | ospfapi clients. The libtool info pages (node Versioning) explain |
| 254 | when major and minor version numbers should be changed. These values |
| 255 | are set in Makefile.am near the definition of the library. If you |
| 256 | make a change that requires changing the shared library version, |
| 257 | please update Makefile.am. |
| 258 | |
| 259 | libospf exports far more than it should, and is needed by ospfapi |
| 260 | clients. Only bump libospf for changes to functions for which it is |
| 261 | reasonable for a user of ospfapi to call, and please err on the side |
| 262 | of not bumping. |
| 263 | |
| 264 | There is no support intended for installing part of zebra. The core |
| 265 | library libzebra and the included daemons should always be built and |
| 266 | installed together. |
| 267 | |
paul | 74a2dd7 | 2005-04-25 00:37:03 +0000 | [diff] [blame] | 268 | |
Greg Troxel | 5195e17 | 2010-11-03 07:37:23 -0400 | [diff] [blame] | 269 | GIT COMMIT SUBSMISSION |
| 270 | |
Paul Jakma | 724b3ae | 2012-03-07 11:02:05 +0000 | [diff] [blame^] | 271 | The preferred method for submitting changes is to provide git commits via a |
| 272 | publically-accessible git repository, which the maintainers can easily pull. |
| 273 | |
| 274 | The commits should be in a branch based off the Quagga.net master - a |
| 275 | "feature branch". Ideally there should be no commits to this branch other |
| 276 | than those in master, and those intended to be submitted. However, merge |
| 277 | commits to this branch from the Quagga master are permitted, though strongly |
| 278 | discouraged - use another (potentially local and throw-away) branch to test |
| 279 | merge with the latest Quagga master. |
| 280 | |
| 281 | Recommended practice is to keep different logical sets of changes on |
| 282 | separate branches - "topic" or "feature" branches. This allows you to still |
| 283 | merge them together to one branch (potentially local and/or "throw-away") |
| 284 | for testing or use, while retaining smaller, independent branches that are |
| 285 | easier to merge. |
Greg Troxel | 5195e17 | 2010-11-03 07:37:23 -0400 | [diff] [blame] | 286 | |
| 287 | All content guidelines in PATCH SUBMISSION apply. |
| 288 | |
| 289 | |
gdt | d9fd04c | 2003-12-19 19:20:25 +0000 | [diff] [blame] | 290 | PATCH SUBMISSION |
| 291 | |
Paul Jakma | 724b3ae | 2012-03-07 11:02:05 +0000 | [diff] [blame^] | 292 | * For complex changes, contributors are strongly encouraged to first start a |
| 293 | design discussion on the quagga-dev list before starting any coding. |
| 294 | |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 295 | * Send a clean diff against the 'master' branch of the quagga.git |
Greg Troxel | a8e474a | 2010-11-03 07:22:00 -0400 | [diff] [blame] | 296 | repository, in unified diff format, preferably with the '-p' argument to |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 297 | show C function affected by any chunk, and with the -w and -b arguments to |
Greg Troxel | a8e474a | 2010-11-03 07:22:00 -0400 | [diff] [blame] | 298 | minimise changes. E.g: |
gdt | d9fd04c | 2003-12-19 19:20:25 +0000 | [diff] [blame] | 299 | |
Paul Jakma | 3de4277 | 2009-07-28 16:04:35 +0100 | [diff] [blame] | 300 | git diff -up mybranch..remotes/quagga.net/master |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 301 | |
Greg Troxel | 5195e17 | 2010-11-03 07:37:23 -0400 | [diff] [blame] | 302 | It is preferable to use git format-patch, and even more preferred to |
Paul Jakma | 724b3ae | 2012-03-07 11:02:05 +0000 | [diff] [blame^] | 303 | publish a git repostory (see GIT COMMIT SUBSMISSION). |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 304 | |
Greg Troxel | 5195e17 | 2010-11-03 07:37:23 -0400 | [diff] [blame] | 305 | If not using git format-patch, Include the commit message in the email. |
| 306 | |
| 307 | * After a commit, code should have comments explaining to the reviewer |
| 308 | why it is correct, without reference to history. The commit message |
| 309 | should explain why the change is correct. |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 310 | |
Greg Troxel | a8e474a | 2010-11-03 07:22:00 -0400 | [diff] [blame] | 311 | * Include NEWS entries as appropriate. |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 312 | |
gdt | 18323bb | 2004-11-05 13:17:20 +0000 | [diff] [blame] | 313 | * Include only one semantic change or group of changes per patch. |
gdt | d9fd04c | 2003-12-19 19:20:25 +0000 | [diff] [blame] | 314 | |
paul | 85cf0a0 | 2004-01-09 16:34:54 +0000 | [diff] [blame] | 315 | * Do not make gratuitous changes to whitespace. See the w and b arguments |
| 316 | to diff. |
gdt | d9fd04c | 2003-12-19 19:20:25 +0000 | [diff] [blame] | 317 | |
Paul Jakma | 724b3ae | 2012-03-07 11:02:05 +0000 | [diff] [blame^] | 318 | * Changes should be arranged so that the least contraversial and most |
| 319 | trivial are first, and the most complex or more contraversial are last. |
| 320 | This will maximise how many the Quagga maintainers can merge, even if some |
| 321 | other commits need further work. |
| 322 | |
| 323 | * Providing a unit-test is strongly encouraged. Doing so will make it |
| 324 | much easier for maintainers to have confidence that they will be able |
| 325 | to support your change. |
| 326 | |
| 327 | * New code should be arranged so that it easy to verify and test. E.g. |
| 328 | stateful logic should be separated out from functional logic as much as |
| 329 | possible: wherever possible, move complex logic out to smaller helper |
| 330 | functions which access no state other than their arguments. |
| 331 | |
gdt | d9fd04c | 2003-12-19 19:20:25 +0000 | [diff] [blame] | 332 | * State on which platforms and with what daemons the patch has been |
| 333 | tested. Understand that if the set of testing locations is small, |
| 334 | and the patch might have unforeseen or hard to fix consequences that |
| 335 | there may be a call for testers on quagga-dev, and that the patch |
| 336 | may be blocked until test results appear. |
| 337 | |
| 338 | If there are no users for a platform on quagga-dev who are able and |
| 339 | willing to verify -current occasionally, that platform may be |
| 340 | dropped from the "should be checked" list. |
| 341 | |
paul | 74a2dd7 | 2005-04-25 00:37:03 +0000 | [diff] [blame] | 342 | |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 343 | PATCH APPLICATION |
gdt | d9fd04c | 2003-12-19 19:20:25 +0000 | [diff] [blame] | 344 | |
| 345 | * Only apply patches that meet the submission guidelines. |
| 346 | |
gdt | d9fd04c | 2003-12-19 19:20:25 +0000 | [diff] [blame] | 347 | * If the patch might break something, issue a call for testing on the |
| 348 | mailinglist. |
| 349 | |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 350 | * Give an appropriate commit message (see above), and use the --author |
| 351 | argument to git-commit, if required, to ensure proper attribution (you |
| 352 | should still be listed as committer) |
| 353 | |
| 354 | * Immediately after commiting, double-check (with git-log and/or gitk). If |
| 355 | there's a small mistake you can easily fix it with 'git commit --amend ..' |
paul | 4134ceb | 2004-05-13 13:38:06 +0000 | [diff] [blame] | 356 | |
Paul Jakma | 724b3ae | 2012-03-07 11:02:05 +0000 | [diff] [blame^] | 357 | * When merging a branch, always use an explicit merge commit. Giving --no-ff |
| 358 | ensures a merge commit is created which documents "this human decided to |
| 359 | merge this branch at this time". |
paul | 74a2dd7 | 2005-04-25 00:37:03 +0000 | [diff] [blame] | 360 | |
gdt | d9fd04c | 2003-12-19 19:20:25 +0000 | [diff] [blame] | 361 | STABLE PLATFORMS AND DAEMONS |
| 362 | |
| 363 | The list of platforms that should be tested follow. This is a list |
| 364 | derived from what quagga is thought to run on and for which |
| 365 | maintainers can test or there are people on quagga-dev who are able |
| 366 | and willing to verify that -current does or does not work correctly. |
| 367 | |
| 368 | BSD (Free, Net or Open, any platform) # without capabilities |
| 369 | GNU/Linux (any distribution, i386) |
paul | 1f8f61a | 2004-11-05 23:38:20 +0000 | [diff] [blame] | 370 | Solaris (strict alignment, any platform) |
gdt | 18323bb | 2004-11-05 13:17:20 +0000 | [diff] [blame] | 371 | [future: NetBSD/sparc64] |
gdt | d9fd04c | 2003-12-19 19:20:25 +0000 | [diff] [blame] | 372 | |
| 373 | The list of daemons that are thought to be stable and that should be |
| 374 | tested are: |
| 375 | |
| 376 | zebra |
| 377 | bgpd |
| 378 | ripd |
| 379 | ospfd |
| 380 | ripngd |
gdt | 1f431d2 | 2003-12-22 15:45:01 +0000 | [diff] [blame] | 381 | |
gdt | 18323bb | 2004-11-05 13:17:20 +0000 | [diff] [blame] | 382 | Daemons which are in a testing phase are |
| 383 | |
| 384 | ospf6d |
| 385 | isisd |
ajs | 8035e9f | 2004-12-22 03:16:59 +0000 | [diff] [blame] | 386 | watchquagga |
gdt | 18323bb | 2004-11-05 13:17:20 +0000 | [diff] [blame] | 387 | |
paul | 74a2dd7 | 2005-04-25 00:37:03 +0000 | [diff] [blame] | 388 | |
jardin | 9e867fe | 2003-12-23 08:56:18 +0000 | [diff] [blame] | 389 | IMPORT OR UPDATE VENDOR SPECIFIC ROUTING PROTOCOLS |
| 390 | |
| 391 | The source code of Quagga is based on two vendors: |
| 392 | |
| 393 | zebra_org (http://www.zebra.org/) |
| 394 | isisd_sf (http://isisd.sf.net/) |
| 395 | |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 396 | To import code from further sources, e.g. for archival purposes without |
| 397 | necessarily having to review and/or fix some changeset, create a branch from |
| 398 | 'master': |
gdt | 18323bb | 2004-11-05 13:17:20 +0000 | [diff] [blame] | 399 | |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 400 | git checkout -b archive/foo master |
| 401 | <apply changes> |
| 402 | git commit -a "Joe Bar <joe@example.com>" |
| 403 | git push quagga archive/foo |
jardin | 9e867fe | 2003-12-23 08:56:18 +0000 | [diff] [blame] | 404 | |
Paul Jakma | d6bb5aa | 2008-08-26 22:15:03 +0100 | [diff] [blame] | 405 | presuming 'quagga' corresponds to a file in your .git/remotes with |
| 406 | configuration for the appropriate Quagga.net repository. |