CONTRIBUTING revision 1.7
11.7Schristos# Contributing to the tz code and data
21.7Schristos
31.7SchristosPlease do not create issues or pull requests on GitHub, as the
41.7Schristosproper procedure for proposing and distributing patches is via
51.7Schristosemail as described below.
61.1Schristos
71.1SchristosThe time zone database is by no means authoritative: governments
81.1Schristoschange timekeeping rules erratically and sometimes with little
91.1Schristoswarning, the data entries do not cover all of civil time before
101.1Schristos1970, and undoubtedly errors remain in the code and data.  Feel
111.1Schristosfree to fill gaps or fix mistakes, and please email improvements
121.7Schristosto <tz@iana.org> for use in the future.  In your email, please give
131.3Schristosreliable sources that reviewers can check.
141.3Schristos
151.7Schristos## Contributing technical changes
161.1Schristos
171.1SchristosTo email small changes, please run a POSIX shell command like
181.1Schristos'diff -u old/europe new/europe >myfix.patch', and attach
191.7Schristos'myfix.patch' to the email.
201.1Schristos
211.5SchristosFor more-elaborate or possibly-controversial changes,
221.5Schristossuch as renaming, adding or removing zones, please read
231.7Schristos"Theory and pragmatics of the tz code and data"
241.7Schristos<https://www.iana.org/time-zones/repository/theory.html>.
251.7SchristosIt is also good to browse the mailing list archives
261.5Schristos<https://mm.icann.org/pipermail/tz/> for examples of patches that tend
271.5Schristosto work well.  Additions to data should contain commentary citing
281.7Schristosreliable sources as justification.  Citations should use "https:" URLs
291.5Schristosif available.
301.1Schristos
311.6SchristosFor changes that fix sensitive security-related bugs, please see the
321.7Schristosdistribution's 'SECURITY' file.
331.6Schristos
341.7SchristosPlease submit changes against either the latest release
351.6Schristos<https://www.iana.org/time-zones> or the main branch of the development
361.7Schristosrepository.  The latter is preferred.
371.7Schristos
381.7Schristos## Sample Git workflow for developing contributions
391.7Schristos
401.7SchristosIf you use Git the following workflow may be helpful:
411.1Schristos
421.2Schristos  * Copy the development repository.
431.1Schristos
441.7Schristos        git clone https://github.com/eggert/tz.git
451.7Schristos        cd tz
461.1Schristos
471.6Schristos  * Get current with the main branch.
481.1Schristos
491.7Schristos        git checkout main
501.7Schristos        git pull
511.1Schristos
521.1Schristos  * Switch to a new branch for the changes.  Choose a different
531.1Schristos    branch name for each change set.
541.1Schristos
551.7Schristos        git checkout -b mybranch
561.1Schristos
571.4Schristos  * Sleuth by using 'git blame'.  For example, when fixing data for
581.4Schristos    Africa/Sao_Tome, if the command 'git blame africa' outputs a line
591.4Schristos    '2951fa3b (Paul Eggert 2018-01-08 09:03:13 -0800 1068) Zone
601.4Schristos    Africa/Sao_Tome 0:26:56 - LMT 1884', commit 2951fa3b should
611.4Schristos    provide some justification for the 'Zone Africa/Sao_Tome' line.
621.4Schristos
631.1Schristos  * Edit source files.  Include commentary that justifies the
641.1Schristos    changes by citing reliable sources.
651.1Schristos
661.1Schristos  * Debug the changes, e.g.:
671.1Schristos
681.7Schristos        make check
691.7Schristos        make install
701.7Schristos        ./zdump -v America/Los_Angeles
711.1Schristos
721.1Schristos  * For each separable change, commit it in the new branch, e.g.:
731.1Schristos
741.7Schristos        git add northamerica
751.7Schristos        git commit
761.1Schristos
771.1Schristos    See recent 'git log' output for the commit-message style.
781.1Schristos
791.7Schristos  * Create patch files 0001-..., 0002-..., ...
801.1Schristos
811.7Schristos        git format-patch main
821.1Schristos
831.7Schristos  * After reviewing the patch files, send the patches to <tz@iana.org>
841.1Schristos    for others to review.
851.1Schristos
861.7Schristos        git send-email main
871.1Schristos
881.4Schristos    For an archived example of such an email, see
891.7Schristos    "[PROPOSED] Fix off-by-1 error for Jamaica and T&C before 1913"
901.4Schristos    <https://mm.icann.org/pipermail/tz/2018-February/026122.html>.
911.4Schristos
921.6Schristos  * Start anew by getting current with the main branch again
931.1Schristos    (the second step above).
941.1Schristos
951.7Schristos-----
961.7Schristos
971.7SchristosThis file is in the public domain.
98