Re: git cherry-pick timestamping issue

From: Abhijit Menon-Sen <ams(at)toroid(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: git cherry-pick timestamping issue
Date: 2010-09-23 21:46:31
Message-ID: 20100923214631.GA5680@toroid.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 2010-09-23 17:37:51 -0400, tgl(at)sss(dot)pgh(dot)pa(dot)us wrote:
>
> Hm. What git version are you using?

I'm using 1.7.3, yes. It has a bunch of timezone handling changes, but
I'm not sure if there's anything related to your problem. If you don't
have TZ set in your environment, I suppose the following patch *could*
be relevant, since you're in -0400 and I'm in +0530. I haven't tried
to verify this, but if cat-file -p on your backported commit shows an
absurdly high timezone value, then that's the problem.

Anyway, try 1.7.3 and see if it helps?

-- ams

commit 9ba0f0334dd505f78e0374bbe857c5e202f5a778
Author: Jeff King <peff(at)peff(dot)net>
Date: Sun Jul 4 07:00:17 2010 -0400

parse_date: fix signedness in timezone calculation

When no timezone is specified, we deduce the offset by
subtracting the result of mktime from our calculated
timestamp.

However, our timestamp is stored as an unsigned integer,
meaning we perform the subtraction as unsigned. For a
negative offset, this means we wrap to a very high number,
and our numeric timezone is in the millions of hours. You
can see this bug by doing:

$ TZ=EST \
GIT_AUTHOR_DATE='2010-06-01 10:00' \
git commit -a -m foo
$ git cat-file -p HEAD | grep author
author Jeff King <peff(at)peff(dot)net> 1275404416 +119304128

Instead, we should perform this subtraction as a time_t, the
same type that mktime returns.

Signed-off-by: Jeff King <peff(at)peff(dot)net>
Signed-off-by: Junio C Hamano <gitster(at)pobox(dot)com>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2010-09-23 21:51:35 Re: git cherry-pick timestamping issue
Previous Message Tom Lane 2010-09-23 21:37:51 Re: git cherry-pick timestamping issue