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