CONTRIBUTING revision 1.6
11.1SchristosContributing to the tz code and data
21.1Schristos
31.1SchristosThe time zone database is by no means authoritative: governments
41.1Schristoschange timekeeping rules erratically and sometimes with little
51.1Schristoswarning, the data entries do not cover all of civil time before
61.1Schristos1970, and undoubtedly errors remain in the code and data.  Feel
71.1Schristosfree to fill gaps or fix mistakes, and please email improvements
81.3Schristosto tz@iana.org for use in the future.  In your email, please give
91.3Schristosreliable sources that reviewers can check.
101.3Schristos
111.3Schristos-----
121.3Schristos
131.3SchristosDevelopers can contribute technical changes to the source code and
141.3Schristosdata as follows.
151.1Schristos
161.1SchristosTo email small changes, please run a POSIX shell command like
171.1Schristos'diff -u old/europe new/europe >myfix.patch', and attach
181.1Schristosmyfix.patch to the email.
191.1Schristos
201.5SchristosFor more-elaborate or possibly-controversial changes,
211.5Schristossuch as renaming, adding or removing zones, please read
221.5Schristos<https://www.iana.org/time-zones/repository/theory.html> or the file
231.5Schristostheory.html.  It is also good to browse the mailing list archives
241.5Schristos<https://mm.icann.org/pipermail/tz/> for examples of patches that tend
251.5Schristosto work well.  Additions to data should contain commentary citing
261.5Schristosreliable sources as justification.  Citations should use https: URLs
271.5Schristosif available.
281.1Schristos
291.6SchristosFor changes that fix sensitive security-related bugs, please see the
301.6Schristosfile SECURITY.
311.6Schristos
321.1SchristosPlease submit changes against either the latest release in
331.6Schristos<https://www.iana.org/time-zones> or the main branch of the development
341.4Schristosrepository.  The latter is preferred.  If you use Git the following
351.4Schristosworkflow may be helpful:
361.1Schristos
371.2Schristos  * Copy the development repository.
381.1Schristos
391.1Schristos      git clone https://github.com/eggert/tz.git
401.1Schristos      cd tz
411.1Schristos
421.6Schristos  * Get current with the main branch.
431.1Schristos
441.6Schristos      git checkout main
451.1Schristos      git pull
461.1Schristos
471.1Schristos  * Switch to a new branch for the changes.  Choose a different
481.1Schristos    branch name for each change set.
491.1Schristos
501.1Schristos      git checkout -b mybranch
511.1Schristos
521.4Schristos  * Sleuth by using 'git blame'.  For example, when fixing data for
531.4Schristos    Africa/Sao_Tome, if the command 'git blame africa' outputs a line
541.4Schristos    '2951fa3b (Paul Eggert 2018-01-08 09:03:13 -0800 1068) Zone
551.4Schristos    Africa/Sao_Tome 0:26:56 - LMT 1884', commit 2951fa3b should
561.4Schristos    provide some justification for the 'Zone Africa/Sao_Tome' line.
571.4Schristos
581.1Schristos  * Edit source files.  Include commentary that justifies the
591.1Schristos    changes by citing reliable sources.
601.1Schristos
611.1Schristos  * Debug the changes, e.g.:
621.1Schristos
631.1Schristos      make check
641.1Schristos      make install
651.1Schristos      ./zdump -v America/Los_Angeles
661.1Schristos
671.1Schristos  * For each separable change, commit it in the new branch, e.g.:
681.1Schristos
691.1Schristos      git add northamerica
701.1Schristos      git commit
711.1Schristos
721.1Schristos    See recent 'git log' output for the commit-message style.
731.1Schristos
741.1Schristos  * Create patch files 0001-*, 0002-*, ...
751.1Schristos
761.6Schristos      git format-patch main
771.1Schristos
781.1Schristos  * After reviewing the patch files, send the patches to tz@iana.org
791.1Schristos    for others to review.
801.1Schristos
811.6Schristos      git send-email main
821.1Schristos
831.4Schristos    For an archived example of such an email, see
841.4Schristos    <https://mm.icann.org/pipermail/tz/2018-February/026122.html>.
851.4Schristos
861.6Schristos  * Start anew by getting current with the main branch again
871.1Schristos    (the second step above).
881.1Schristos
891.1SchristosPlease do not create issues or pull requests on GitHub, as the
901.1Schristosproper procedure for proposing and distributing patches is via
911.1Schristosemail as illustrated above.
92