[tz] technical details for today's code and data release

Kevin Lyda kevin at ie.suberic.net
Sat Jul 21 07:31:23 UTC 2012


On Sat, Jul 21, 2012 at 6:50 AM, Paul Eggert <eggert at cs.ucla.edu> wrote:
> What would be the typical use cases for tags?
> I'd like to see that, before adding tags of a
> particular stripe.

In git it's quite easy to hop between various revisions. I'll be
taking my historical tz repo down soon, but using it as an example,
you'll see each release is tagged:

https://github.com/lyda/tz

So you can quickly go from https://github.com/lyda/tz/tree/tzdata2010f
to https://github.com/lyda/tz/tree/tzdata1999a

On the command line you can just do: git checkout tzcode1999a

And browse the code from that release there.

You can quickly check the diffs between versions: git diff
tzcode1999b...tzcode1999d

Say someone tells you that the last version of the code without bug X
was tzcode2010c. You write a script that will build the code and run a
test that exits 0 if OK, 1 if bad. You could do the following:

git checkout master
git bisect start
git bisect bad
git bisect good tzcode2010c
git bisect run ~/test-script.sh

It will find the first occurrence of the bug which should help you
identify the change that caused the problem.

You can also use it to see when things first got added.  For example
if you were to put this in ~/test-script.sh:
----
#!/bin/bash

if [[ ! -f zone.tab ]]; then
  exit 0
fi
if grep -q Africa/Luanda zone.tab; then
  exit 1
else
  exit 0
fi
----

and then run:
git checkout master
git bisect start
git bisect bad
git bisect good tzcode93
git bisect run ~/test-script.sh

You'd discover that Africa/Luanda was added to zone.tab in the
tzdata96k release.

Yes, you can do this without tags, but they're easier to remember /
make sense of than git revision numbers (in this tree that release is
e093ff07e6cc1d6e8bf0b6b3472f4a93a0a7c560 for example).

Kevin

-- 
Kevin Lyda
Dublin, Ireland
US Citizen overseas? We can vote.
Register now: http://www.votefromabroad.org/


More information about the tz mailing list