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