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