home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Online / Curl / CONTRIBUTE < prev    next >
Text File  |  2000-07-29  |  4KB  |  85 lines

  1.                                   _   _ ____  _     
  2.                               ___| | | |  _ \| |    
  3.                              / __| | | | |_) | |    
  4.                             | (__| |_| |  _ <| |___ 
  5.                              \___|\___/|_| \_\_____|
  6.  
  7. CONTRIBUTE
  8.  
  9. To Think About When Contributing Source Code
  10.  
  11.  This document is intended to offer some guidelines that can be useful to keep
  12.  in mind when you decide to write a contribution to the project. This concerns
  13.  new features as well as corrections to existing flaws or bugs.
  14.  
  15. The License Issue
  16.  
  17.  When contributing with code, you agree to put your changes and new code under
  18.  the same license curl and libcurl is already using. Curl uses the MozPL, the
  19.  Mozilla Public License, which is *NOT* compatible with the well known GPL,
  20.  GNU Public License. We can never re-use sources from a GPL program in curl.
  21.  If you add a larger piece of code, you can opt to make that file or set of
  22.  files to use a different license as long as they don't enfore any changes to
  23.  the rest of the package. Such "separate parts" can not be GPL either.
  24.  
  25. Naming
  26.  
  27.  Try using a non-confusing naming scheme for your new functions and variable
  28.  names. It doesn't necessarily have to mean that you should use the same as in
  29.  other places of the code, just that the names should be logical,
  30.  understandable and be named according to what they're used for.
  31.  
  32. Indenting
  33.  
  34.  Please try using the same indenting levels and bracing method as all the
  35.  other code already does. It makes the source code a lot easier to follow if
  36.  all of it is written using the same style. I don't ask you to like it, I just
  37.  ask you to follow the tradition! ;-)
  38.  
  39. Commenting
  40.  
  41.  Comment your source code extensively. I don't see myself as a very good
  42.  source commenter, but I try to become one. Commented code is quality code and
  43.  enables future modifications much more. Uncommented code much more risk being
  44.  completely replaced when someone wants to extend things, since other persons'
  45.  source code can get quite hard to read.
  46.  
  47. General Style
  48.  
  49.  Keep your functions small. If they're small you avoid a lot of mistakes and
  50.  you don't accidentally mix up variables.
  51.  
  52. Non-clobbering All Over
  53.  
  54.  When you write new functionality or fix bugs, it is important that you don't
  55.  fiddle all over the source files and functions. Remember that it is likely
  56.  that other people have done changes in the same source files as you have and
  57.  possibly even in the same functions. If you bring completely new
  58.  functionality, try writing it in a new source file. If you fix bugs, try to
  59.  fix one bug at a time and send them as separate patches.
  60.  
  61. Separate Patches Doing Different Things
  62.  
  63.  It is annoying when you get a huge patch from someone that is said to fix 511
  64.  odd problems, but discussions and opinions don't agree with 510 of them - or
  65.  509 of them were already fixed in a different way. Then the patcher needs to
  66.  extract the single interesting patch from somewhere within the huge pile of
  67.  source, and that gives a lot of extra work. Preferably, all fixes that
  68.  correct different problems should be in their own patch with an attached
  69.  description exactly what they correct so that all patches can be selectively
  70.  applied by the maintainer or other interested parties.
  71.  
  72. Document
  73.  
  74.  Writing docs is dead boring and one of the big problems with many open source
  75.  projects. Someone's gotta do it. It makes it a lot easier if you submit a
  76.  small description of your fix or your new features with every contribution so
  77.  that it can be swiftly added to the package documentation.
  78.  
  79. Write Access to CVS Repository
  80.  
  81.  If you are a frequent contributor, or have another good reason, you can of
  82.  course get write access to the CVS repository and then you'll be able to
  83.  check-in all your changes straight into the CVS tree instead of sending all
  84.  changes by mail as patches. Just ask if this is what you'd want.
  85.