Home | History | Annotate | Line # | Download | only in time
      1  1.7  christos # Contributing to the tz code and data
      2  1.7  christos 
      3  1.7  christos Please do not create issues or pull requests on GitHub, as the
      4  1.7  christos proper procedure for proposing and distributing patches is via
      5  1.7  christos email as described below.
      6  1.1  christos 
      7  1.1  christos The time zone database is by no means authoritative: governments
      8  1.1  christos change timekeeping rules erratically and sometimes with little
      9  1.1  christos warning, the data entries do not cover all of civil time before
     10  1.1  christos 1970, and undoubtedly errors remain in the code and data.  Feel
     11  1.1  christos free to fill gaps or fix mistakes, and please email improvements
     12  1.7  christos to <tz (a] iana.org> for use in the future.  In your email, please give
     13  1.3  christos reliable sources that reviewers can check.
     14  1.3  christos 
     15  1.7  christos ## Contributing technical changes
     16  1.1  christos 
     17  1.1  christos To email small changes, please run a POSIX shell command like
     18  1.1  christos 'diff -u old/europe new/europe >myfix.patch', and attach
     19  1.7  christos 'myfix.patch' to the email.
     20  1.1  christos 
     21  1.8  christos For more-elaborate or possibly controversial changes,
     22  1.5  christos such as renaming, adding or removing zones, please read
     23  1.7  christos "Theory and pragmatics of the tz code and data"
     24  1.7  christos <https://www.iana.org/time-zones/repository/theory.html>.
     25  1.7  christos It is also good to browse the mailing list archives
     26  1.9  christos <https://lists.iana.org/hyperkitty/list/tz@iana.org/>
     27  1.9  christos for examples of patches that tend to work well.
     28  1.9  christos Changes should contain commentary citing reliable sources.
     29  1.9  christos Citations should use "https:" URLs if available.
     30  1.1  christos 
     31  1.6  christos For changes that fix sensitive security-related bugs, please see the
     32  1.7  christos distribution's 'SECURITY' file.
     33  1.6  christos 
     34  1.7  christos Please submit changes against either the latest release
     35  1.6  christos <https://www.iana.org/time-zones> or the main branch of the development
     36  1.7  christos repository.  The latter is preferred.
     37  1.7  christos 
     38  1.7  christos ## Sample Git workflow for developing contributions
     39  1.7  christos 
     40  1.7  christos If you use Git the following workflow may be helpful:
     41  1.1  christos 
     42  1.2  christos   * Copy the development repository.
     43  1.1  christos 
     44  1.7  christos         git clone https://github.com/eggert/tz.git
     45  1.7  christos         cd tz
     46  1.1  christos 
     47  1.6  christos   * Get current with the main branch.
     48  1.1  christos 
     49  1.7  christos         git checkout main
     50  1.7  christos         git pull
     51  1.1  christos 
     52  1.1  christos   * Switch to a new branch for the changes.  Choose a different
     53  1.1  christos     branch name for each change set.
     54  1.1  christos 
     55  1.7  christos         git checkout -b mybranch
     56  1.1  christos 
     57  1.4  christos   * Sleuth by using 'git blame'.  For example, when fixing data for
     58  1.4  christos     Africa/Sao_Tome, if the command 'git blame africa' outputs a line
     59  1.4  christos     '2951fa3b (Paul Eggert 2018-01-08 09:03:13 -0800 1068) Zone
     60  1.4  christos     Africa/Sao_Tome 0:26:56 - LMT 1884', commit 2951fa3b should
     61  1.4  christos     provide some justification for the 'Zone Africa/Sao_Tome' line.
     62  1.4  christos 
     63  1.1  christos   * Edit source files.  Include commentary that justifies the
     64  1.1  christos     changes by citing reliable sources.
     65  1.1  christos 
     66  1.9  christos   * Debug the changes locally, e.g.:
     67  1.1  christos 
     68  1.9  christos         make TOPDIR=$PWD/tz clean check install
     69  1.7  christos         ./zdump -v America/Los_Angeles
     70  1.1  christos 
     71  1.9  christos     Although builds assume only basic POSIX, they use extra features
     72  1.9  christos     if available.  'make check' accesses validator.w3.org unless you
     73  1.9  christos     lack 'curl' or use 'make CURL=:'.  If you have the latest GCC,
     74  1.9  christos     "make CFLAGS='$(GCC_DEBUG_FLAGS)'" does extra checking.
     75  1.9  christos 
     76  1.1  christos   * For each separable change, commit it in the new branch, e.g.:
     77  1.1  christos 
     78  1.7  christos         git add northamerica
     79  1.7  christos         git commit
     80  1.1  christos 
     81  1.1  christos     See recent 'git log' output for the commit-message style.
     82  1.1  christos 
     83  1.7  christos   * Create patch files 0001-..., 0002-..., ...
     84  1.1  christos 
     85  1.7  christos         git format-patch main
     86  1.1  christos 
     87  1.7  christos   * After reviewing the patch files, send the patches to <tz (a] iana.org>
     88  1.1  christos     for others to review.
     89  1.1  christos 
     90  1.7  christos         git send-email main
     91  1.1  christos 
     92  1.4  christos     For an archived example of such an email, see
     93  1.7  christos     "[PROPOSED] Fix off-by-1 error for Jamaica and T&C before 1913"
     94  1.4  christos     <https://mm.icann.org/pipermail/tz/2018-February/026122.html>.
     95  1.4  christos 
     96  1.6  christos   * Start anew by getting current with the main branch again
     97  1.1  christos     (the second step above).
     98  1.1  christos 
     99  1.7  christos -----
    100  1.7  christos 
    101  1.7  christos This file is in the public domain.
    102