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 138d7edd17SPhilip Paepsreliable sources that reviewers can check. 148d7edd17SPhilip Paeps 158ea5af2bSPhilip Paeps## Contributing technical changes 16ba2b2efdSGlen Barber 17ba2b2efdSGlen BarberTo email small changes, please run a POSIX shell command like 18ba2b2efdSGlen Barber'diff -u old/europe new/europe >myfix.patch', and attach 198ea5af2bSPhilip Paeps'myfix.patch' to the email. 20ba2b2efdSGlen Barber 21259e2ad7SPhilip PaepsFor more-elaborate or possibly controversial changes, 2289abb9f8SPhilip Paepssuch as renaming, adding or removing zones, please read 238ea5af2bSPhilip Paeps"Theory and pragmatics of the tz code and data" 248ea5af2bSPhilip Paeps<https://www.iana.org/time-zones/repository/theory.html>. 258ea5af2bSPhilip PaepsIt is also good to browse the mailing list archives 26*e273650fSPhilip Paeps<https://lists.iana.org/hyperkitty/list/tz@iana.org/> 27*e273650fSPhilip Paepsfor examples of patches that tend to work well. 28*e273650fSPhilip PaepsChanges should contain commentary citing reliable sources. 29*e273650fSPhilip PaepsCitations should use "https:" URLs if available. 30ba2b2efdSGlen Barber 3194c2d487SPhilip PaepsFor changes that fix sensitive security-related bugs, please see the 328ea5af2bSPhilip Paepsdistribution's 'SECURITY' file. 3394c2d487SPhilip Paeps 348ea5af2bSPhilip PaepsPlease submit changes against either the latest release 3594c2d487SPhilip Paeps<https://www.iana.org/time-zones> or the main branch of the development 368ea5af2bSPhilip Paepsrepository. The latter is preferred. 378ea5af2bSPhilip Paeps 388ea5af2bSPhilip Paeps## Sample Git workflow for developing contributions 398ea5af2bSPhilip Paeps 408ea5af2bSPhilip PaepsIf you use Git the following workflow may be helpful: 41ba2b2efdSGlen Barber 42e350c46aSBaptiste Daroussin * Copy the development repository. 43ba2b2efdSGlen Barber 44ba2b2efdSGlen Barber git clone https://github.com/eggert/tz.git 45ba2b2efdSGlen Barber cd tz 46ba2b2efdSGlen Barber 4794c2d487SPhilip Paeps * Get current with the main branch. 48ba2b2efdSGlen Barber 4994c2d487SPhilip Paeps git checkout main 50ba2b2efdSGlen Barber git pull 51ba2b2efdSGlen Barber 52ba2b2efdSGlen Barber * Switch to a new branch for the changes. Choose a different 53ba2b2efdSGlen Barber branch name for each change set. 54ba2b2efdSGlen Barber 55ba2b2efdSGlen Barber git checkout -b mybranch 56ba2b2efdSGlen Barber 5746bee4edSPhilip Paeps * Sleuth by using 'git blame'. For example, when fixing data for 5846bee4edSPhilip Paeps Africa/Sao_Tome, if the command 'git blame africa' outputs a line 5946bee4edSPhilip Paeps '2951fa3b (Paul Eggert 2018-01-08 09:03:13 -0800 1068) Zone 6046bee4edSPhilip Paeps Africa/Sao_Tome 0:26:56 - LMT 1884', commit 2951fa3b should 6146bee4edSPhilip Paeps provide some justification for the 'Zone Africa/Sao_Tome' line. 6246bee4edSPhilip Paeps 63ba2b2efdSGlen Barber * Edit source files. Include commentary that justifies the 64ba2b2efdSGlen Barber changes by citing reliable sources. 65ba2b2efdSGlen Barber 66*e273650fSPhilip Paeps * Debug the changes locally, e.g.: 67ba2b2efdSGlen Barber 68*e273650fSPhilip Paeps make TOPDIR=$PWD/tz clean check install 69ba2b2efdSGlen Barber ./zdump -v America/Los_Angeles 70ba2b2efdSGlen Barber 71*e273650fSPhilip Paeps Although builds assume only basic POSIX, they use extra features 72*e273650fSPhilip Paeps if available. 'make check' accesses validator.w3.org unless you 73*e273650fSPhilip Paeps lack 'curl' or use 'make CURL=:'. If you have the latest GCC, 74*e273650fSPhilip Paeps "make CFLAGS='$(GCC_DEBUG_FLAGS)'" does extra checking. 75*e273650fSPhilip Paeps 76ba2b2efdSGlen Barber * For each separable change, commit it in the new branch, e.g.: 77ba2b2efdSGlen Barber 78ba2b2efdSGlen Barber git add northamerica 79ba2b2efdSGlen Barber git commit 80ba2b2efdSGlen Barber 81ba2b2efdSGlen Barber See recent 'git log' output for the commit-message style. 82ba2b2efdSGlen Barber 838ea5af2bSPhilip Paeps * Create patch files 0001-..., 0002-..., ... 84ba2b2efdSGlen Barber 8594c2d487SPhilip Paeps git format-patch main 86ba2b2efdSGlen Barber 878ea5af2bSPhilip Paeps * After reviewing the patch files, send the patches to <tz@iana.org> 88ba2b2efdSGlen Barber for others to review. 89ba2b2efdSGlen Barber 9094c2d487SPhilip Paeps git send-email main 91ba2b2efdSGlen Barber 9246bee4edSPhilip Paeps For an archived example of such an email, see 938ea5af2bSPhilip Paeps "[PROPOSED] Fix off-by-1 error for Jamaica and T&C before 1913" 9446bee4edSPhilip Paeps <https://mm.icann.org/pipermail/tz/2018-February/026122.html>. 9546bee4edSPhilip Paeps 9694c2d487SPhilip Paeps * Start anew by getting current with the main branch again 97ba2b2efdSGlen Barber (the second step above). 98ba2b2efdSGlen Barber 99ba2b2efdSGlen Barber----- 100ba2b2efdSGlen Barber 101ba2b2efdSGlen BarberThis file is in the public domain. 102