xref: /freebsd/contrib/tzdata/CONTRIBUTING (revision a86dc94b84d177da8f00d1c9420ef0860576e4c4)
18ea5af2bSPhilip Paeps# Contributing to the tz code and data
28ea5af2bSPhilip Paeps
38ea5af2bSPhilip PaepsPlease do not create issues or pull requests on GitHub, as the
48ea5af2bSPhilip Paepsproper procedure for proposing and distributing patches is via
58ea5af2bSPhilip Paepsemail as described below.
6ba2b2efdSGlen Barber
7ba2b2efdSGlen BarberThe time zone database is by no means authoritative: governments
8ba2b2efdSGlen Barberchange timekeeping rules erratically and sometimes with little
9ba2b2efdSGlen Barberwarning, the data entries do not cover all of civil time before
10ba2b2efdSGlen Barber1970, and undoubtedly errors remain in the code and data.  Feel
11ba2b2efdSGlen Barberfree to fill gaps or fix mistakes, and please email improvements
128ea5af2bSPhilip Paepsto <tz@iana.org> for use in the future.  In your email, please give
13*a86dc94bSPhilip Paepsreliable sources that reviewers can check.  The mailing list and its
14*a86dc94bSPhilip Paepsarchives are public, so please do not send confidential information.
158d7edd17SPhilip Paeps
168ea5af2bSPhilip Paeps## Contributing technical changes
17ba2b2efdSGlen Barber
18ba2b2efdSGlen BarberTo email small changes, please run a POSIX shell command like
19*a86dc94bSPhilip Paeps‘diff -u old/europe new/europe >myfix.patch’, and attach
20*a86dc94bSPhilip Paepsmyfix.patch’ to the email.
21ba2b2efdSGlen Barber
22259e2ad7SPhilip PaepsFor more-elaborate or possibly controversial changes,
2389abb9f8SPhilip Paepssuch as renaming, adding or removing zones, please read
24*a86dc94bSPhilip Paeps“Theory and pragmatics of the tz code and data”
258ea5af2bSPhilip Paeps<https://www.iana.org/time-zones/repository/theory.html>.
268ea5af2bSPhilip PaepsIt is also good to browse the mailing list archives
27e273650fSPhilip Paeps<https://lists.iana.org/hyperkitty/list/tz@iana.org/>
28e273650fSPhilip Paepsfor examples of patches that tend to work well.
29e273650fSPhilip PaepsChanges should contain commentary citing reliable sources.
30*a86dc94bSPhilip PaepsCitations should use ‘https:’ URLs if available.
31ba2b2efdSGlen Barber
3294c2d487SPhilip PaepsFor changes that fix sensitive security-related bugs, please see the
33*a86dc94bSPhilip Paepsdistribution’s SECURITY file.
3494c2d487SPhilip Paeps
358ea5af2bSPhilip PaepsPlease submit changes against either the latest release
3694c2d487SPhilip Paeps<https://www.iana.org/time-zones> or the main branch of the development
378ea5af2bSPhilip Paepsrepository.  The latter is preferred.
388ea5af2bSPhilip Paeps
398ea5af2bSPhilip Paeps## Sample Git workflow for developing contributions
408ea5af2bSPhilip Paeps
418ea5af2bSPhilip PaepsIf you use Git the following workflow may be helpful:
42ba2b2efdSGlen Barber
43e350c46aSBaptiste Daroussin  * Copy the development repository.
44ba2b2efdSGlen Barber
45ba2b2efdSGlen Barber        git clone https://github.com/eggert/tz.git
46ba2b2efdSGlen Barber        cd tz
47ba2b2efdSGlen Barber
4894c2d487SPhilip Paeps  * Get current with the main branch.
49ba2b2efdSGlen Barber
5094c2d487SPhilip Paeps        git checkout main
51ba2b2efdSGlen Barber        git pull
52ba2b2efdSGlen Barber
53ba2b2efdSGlen Barber  * Switch to a new branch for the changes.  Choose a different
54ba2b2efdSGlen Barber    branch name for each change set.
55ba2b2efdSGlen Barber
56ba2b2efdSGlen Barber        git checkout -b mybranch
57ba2b2efdSGlen Barber
58*a86dc94bSPhilip Paeps  * Sleuth by using ‘git blame’.  For example, when fixing data for
59*a86dc94bSPhilip Paeps    Africa/Sao_Tome, if the command ‘git blame africa’ outputs a line
60*a86dc94bSPhilip Paeps    ‘2951fa3b (Paul Eggert 2018-01-08 09:03:13 -0800 1068) Zone
61*a86dc94bSPhilip Paeps    Africa/Sao_Tome 0:26:56 - LMT 1884’, commit 2951fa3b should
62*a86dc94bSPhilip Paeps    provide some justification for the ‘Zone Africa/Sao_Tome’ line.
6346bee4edSPhilip Paeps
64ba2b2efdSGlen Barber  * Edit source files.  Include commentary that justifies the
65ba2b2efdSGlen Barber    changes by citing reliable sources.
66ba2b2efdSGlen Barber
67e273650fSPhilip Paeps  * Debug the changes locally, e.g.:
68ba2b2efdSGlen Barber
69e273650fSPhilip Paeps        make TOPDIR=$PWD/tz clean check install
70ba2b2efdSGlen Barber        ./zdump -v America/Los_Angeles
71ba2b2efdSGlen Barber
72e273650fSPhilip Paeps    Although builds assume only basic POSIX, they use extra features
73*a86dc94bSPhilip Paeps    if available.  ‘make check’ accesses validator.w3.org unless you
74*a86dc94bSPhilip Paeps    lack ‘curl’ or use ‘make CURL=:’.  If you have the latest GCC,
75*a86dc94bSPhilip Paeps    ‘make CFLAGS='$(GCC_DEBUG_FLAGS)'’ does extra checking.
76e273650fSPhilip Paeps
77ba2b2efdSGlen Barber  * For each separable change, commit it in the new branch, e.g.:
78ba2b2efdSGlen Barber
79ba2b2efdSGlen Barber        git add northamerica
80ba2b2efdSGlen Barber        git commit
81ba2b2efdSGlen Barber
82*a86dc94bSPhilip Paeps    See recent ‘git log’ output for the commit-message style.
83ba2b2efdSGlen Barber
848ea5af2bSPhilip Paeps  * Create patch files 0001-..., 0002-..., ...
85ba2b2efdSGlen Barber
8694c2d487SPhilip Paeps        git format-patch main
87ba2b2efdSGlen Barber
88*a86dc94bSPhilip Paeps  * Check that the patch files and your email setup contain only
89*a86dc94bSPhilip Paeps    information that you want to make public.
90*a86dc94bSPhilip Paeps
918ea5af2bSPhilip Paeps  * After reviewing the patch files, send the patches to <tz@iana.org>
92ba2b2efdSGlen Barber    for others to review.
93ba2b2efdSGlen Barber
9494c2d487SPhilip Paeps        git send-email main
95ba2b2efdSGlen Barber
9646bee4edSPhilip Paeps    For an archived example of such an email, see
97*a86dc94bSPhilip Paeps    “[PROPOSED] Fix off-by-1 error for Jamaica and T&C before 1913”
9846bee4edSPhilip Paeps    <https://mm.icann.org/pipermail/tz/2018-February/026122.html>.
9946bee4edSPhilip Paeps
10094c2d487SPhilip Paeps  * Start anew by getting current with the main branch again
101ba2b2efdSGlen Barber    (the second step above).
102ba2b2efdSGlen Barber
103ba2b2efdSGlen Barber-----
104ba2b2efdSGlen Barber
105ba2b2efdSGlen BarberThis file is in the public domain.
106