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