Blame doc/HACKING

Packit d7e8d0
# HACKING                                                       -*- org -*-
Packit d7e8d0
#+TITLE: Hacking notes for GPGME
Packit d7e8d0
#+STARTUP: showall
Packit d7e8d0
Packit d7e8d0
* How to contribute
Packit d7e8d0
** No more ChangeLog files
Packit d7e8d0
Packit d7e8d0
  Do not modify any of the ChangeLog files in GPGME.  Starting
Packit d7e8d0
  on December 1st, 2011 we put change information only in the GIT
Packit d7e8d0
  commit log, and generate a top-level ChangeLog file from logs at
Packit d7e8d0
  "make dist" time.  As such, there are strict requirements on the
Packit d7e8d0
  form of the commit log messages.  The old ChangeLog files have all
Packit d7e8d0
  be renamed to ChangeLog-2011
Packit d7e8d0
Packit d7e8d0
Packit d7e8d0
** Commit log requirements
Packit d7e8d0
Packit d7e8d0
  Your commit log should always start with a one-line summary, the
Packit d7e8d0
  second line should be blank, and the remaining lines are usually
Packit d7e8d0
  ChangeLog-style entries for all affected files.  However, it's fine
Packit d7e8d0
  -- even recommended -- to write a few lines of prose describing the
Packit d7e8d0
  change, when the summary and ChangeLog entries don't give enough of
Packit d7e8d0
  the big picture.  Omit the leading TABs that you're used to seeing
Packit d7e8d0
  in a "real" ChangeLog file, but keep the maximum line length at 72
Packit d7e8d0
  or smaller, so that the generated ChangeLog lines, each with its
Packit d7e8d0
  leading TAB, will not exceed 80 columns.  If you want to add text
Packit d7e8d0
  which shall not be copied to the ChangeLog, separate it by a line
Packit d7e8d0
  consisting of two dashes at the begin of a line.
Packit d7e8d0
Packit d7e8d0
  Note that ./autogen.sh installs a git hook to do some basic syntax
Packit d7e8d0
  checking on the commit log message.
Packit d7e8d0
Packit d7e8d0
  Typo fixes and documentation updates don't need a ChangeLog entry;
Packit d7e8d0
  thus you would use a commit message like
Packit d7e8d0
Packit d7e8d0
  #+begin_example
Packit d7e8d0
  Fix typo in a comment
Packit d7e8d0
Packit d7e8d0
  --
Packit d7e8d0
  #+end_example
Packit d7e8d0
Packit d7e8d0
  The marker line here is important; without it the first line would
Packit d7e8d0
  appear in the ChangeLog.
Packit d7e8d0
Packit d7e8d0
  If you exceptionally need to have longer lines in a commit log you may
Packit d7e8d0
  do this after this scissor line:
Packit d7e8d0
  #+begin_example
Packit d7e8d0
  # ------------------------ >8 ------------------------
Packit d7e8d0
  #+end_example
Packit d7e8d0
  (hash, blank, 24 dashes, blank, scissor, blank, 24 dashes).
Packit d7e8d0
  Note that such a comment will be removed if the git commit option
Packit d7e8d0
  =--cleanup-scissor= is used.
Packit d7e8d0
Packit d7e8d0
** License policy
Packit d7e8d0
Packit d7e8d0
  GPGME is currently licensed under the LGPLv2.1+ with tools and the
Packit d7e8d0
  manual being under the GPLv3+.  We may eventually update to a newer
Packit d7e8d0
  version of the licenses or a combination of them.  It is thus
Packit d7e8d0
  important, that all contributed code allows for an update of the
Packit d7e8d0
  license; for example we can't accept code under the LGPLv2(only).
Packit d7e8d0
Packit d7e8d0
  If you want to contribute code or documentation to GPGME you are
Packit d7e8d0
  asked to assert that the contribution is in accordance to the "GPGME
Packit d7e8d0
  Developer's Certificate of Origin" as found in the file "DCO".
Packit d7e8d0
  Except for a slight wording change, this DCO is identical to the one
Packit d7e8d0
  used by the Linux kernel.  Please take these simple steps:
Packit d7e8d0
Packit d7e8d0
  - Decide which mail address you want to use.  Please have your real
Packit d7e8d0
    name in the address and not a pseudonym.  Anonymous contributions
Packit d7e8d0
    can only be done if you find a proxy who certifies for you.
Packit d7e8d0
Packit d7e8d0
  - If your employer or school might claim ownership of code written
Packit d7e8d0
    by you; you need to talk to them to make sure that you have the
Packit d7e8d0
    right to contribute under the DCO.
Packit d7e8d0
Packit d7e8d0
  - Send an OpenPGP signed mail to the gnupg-devel@gnupg.org public
Packit d7e8d0
    mailing list from your mail address.  Include a copy of the DCO as
Packit d7e8d0
    found in the official master branch.  Insert your name and email
Packit d7e8d0
    address into the DCO in the same way you want to use it later.
Packit d7e8d0
    Example:
Packit d7e8d0
Packit d7e8d0
      Signed-off-by: Joe R. Hacker <joe@example.org>
Packit d7e8d0
Packit d7e8d0
    If you need it, you may perform simple transformations on the mail
Packit d7e8d0
    address: Replacing "@" by " at " or "." by " dot ".)
Packit d7e8d0
Packit d7e8d0
  - That's it.  From now on you only need to add a "Signed-off-by:"
Packit d7e8d0
    line with your name and mail address to the GIT commit message.
Packit d7e8d0
    It is recommended to send the patches using a PGP/MIME signed
Packit d7e8d0
    mail.
Packit d7e8d0
Packit d7e8d0
** Coding standards
Packit d7e8d0
Packit d7e8d0
  Please follow the GNU coding standards.  If you are in doubt consult
Packit d7e8d0
  the existing code as an example.  Do no re-indent code without a
Packit d7e8d0
  need.  If you really need to do it, use a separate commit for such a
Packit d7e8d0
  change.
Packit d7e8d0
Packit d7e8d0
  - C99 syntax should not be used; stick to C90.
Packit d7e8d0
  - Please do not use C++ =//= style comments.
Packit d7e8d0
  - Try to fit lines into 80 columns.
Packit d7e8d0
  - Ignore signed/unsigned pointer mismatches
Packit d7e8d0
  - No arithmetic on void pointers; cast to char* first.
Packit d7e8d0
Packit d7e8d0
** Commit log keywords
Packit d7e8d0
Packit d7e8d0
  - GnuPG-bug-id :: Values are comma or space delimited bug numbers
Packit d7e8d0
                    from bug.gnupg.org pertaining to this commit.
Packit d7e8d0
  - Debian-bug-id :: Same as above but from the Debian bug tracker.
Packit d7e8d0
  - CVE-id :: CVE id number pertaining to this commit.
Packit d7e8d0
  - Regression-due-to :: Commit id of the regression fixed by this commit.
Packit d7e8d0
  - Fixes-commit :: Commit id this commit fixes.
Packit d7e8d0
  - Reported-by :: Value is a name or mail address of a bug reporte.
Packit d7e8d0
  - Suggested-by :: Value is a name or mail address of someone how
Packit d7e8d0
                    suggested this change.
Packit d7e8d0
  - Co-authored-by :: Name or mail address of a co-author
Packit d7e8d0
  - Some-comments-by :: Name or mail address of the author of
Packit d7e8d0
                        additional comments (commit log or code).
Packit d7e8d0
  - Proofread-by :: Sometimes used by translation commits.
Packit d7e8d0
  - Signed-off-by :: Name or mail address of the developer
Packit d7e8d0
Packit d7e8d0
* Debug hints
Packit d7e8d0
Packit d7e8d0
  - Use gpgme-tool for manual tests.
Packit d7e8d0
  - The envvar GPGME_DEBUG enables debugging; see debug.[ch] for
Packit d7e8d0
    details.