Re: [Bug] git-log prints wrong unixtime with --date=format:%s

2016-05-19 Thread Michael Heerdegen
Jeff King writes: > Oh, I agree that unix times are handy. I just think that "use %at in the > pretty-format, instead of %ad and then %s in the date-format" is not > such a bad workaround. I had missed %at (and %ct). Yes, works perfectly - thanks for the hint. Regards,

Re: [Bug] git-log prints wrong unixtime with --date=format:%s

2016-05-18 Thread Jeff King
On Thu, May 19, 2016 at 01:05:28AM +0200, Michael Heerdegen wrote: > Jeff King writes: > > > 3. The epoch times for the latter lines should match. > > FWIW, I think the epoch time is the most practical way to transfer the > time of a commit into a different program. When this

Re: [Bug] git-log prints wrong unixtime with --date=format:%s

2016-05-18 Thread Michael Heerdegen
Jeff King writes: > 3. The epoch times for the latter lines should match. FWIW, I think the epoch time is the most practical way to transfer the time of a commit into a different program. When this program wants to do it's own date arithmetic with it, unix time is just nice

Re: [Bug] git-log prints wrong unixtime with --date=format:%s

2016-05-18 Thread Michael Heerdegen
Jeff King writes: > This is probably a totally separate issue, as it would not be using > strftime (or IIRC, any of the standard time functions at all). Do you > have a detailed example that shows the problem? Ok, this was probably false alarm. Magit (An Emacs Git front end)

Re: [Bug] git-log prints wrong unixtime with --date=format:%s

2016-05-18 Thread Jeff King
On Wed, May 18, 2016 at 12:44:43PM -0400, Randall S. Becker wrote: > Off the wall: Dealing in a dispersed team sharing a server that has a > timezone local for only two of the members, git log messes with me also from > a TZ POV. I would like to suggest a more general solution, like configuring >

Re: [Bug] git-log prints wrong unixtime with --date=format:%s

2016-05-18 Thread Jeff King
On Wed, May 18, 2016 at 09:21:34AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > I tried a few obvious things, but couldn't make anything work. Setting > > "timezone" manually seems to do nothing. It's supposed to be set by > > putting the right thing in $TZ and then

RE: [Bug] git-log prints wrong unixtime with --date=format:%s

2016-05-18 Thread Randall S. Becker
On May 18, 2016 12:22 PM Jeff King wrote: > > I tried a few obvious things, but couldn't make anything work. Setting > > "timezone" manually seems to do nothing. It's supposed to be set by > > putting the right thing in $TZ and then calling tzset(). So I tried > > munging $TZ to something like

Re: [Bug] git-log prints wrong unixtime with --date=format:%s

2016-05-18 Thread Junio C Hamano
Jeff King writes: > I tried a few obvious things, but couldn't make anything work. Setting > "timezone" manually seems to do nothing. It's supposed to be set by > putting the right thing in $TZ and then calling tzset(). So I tried > munging $TZ to something like "+0200". It did

Re: [Bug] git-log prints wrong unixtime with --date=format:%s

2016-05-17 Thread Jeff King
On Tue, May 17, 2016 at 08:40:08PM -0400, Jeff King wrote: > So we need some way to tell strftime "...and by the way, this is the > timezone for the value we are currently feeding you." There isn't a slot > in "struct tm" for that, but I think maybe you can hack around it by > setting the global

Re: [Bug] git-log prints wrong unixtime with --date=format:%s

2016-05-17 Thread Jeff King
On Tue, May 17, 2016 at 07:25:31PM +0200, Michael Heerdegen wrote: > Michael Heerdegen writes: > > > the command > > > >git log --pretty=format:%ad --date=format:%s > > > > displays wrong unixtime values; apparently how much the printed value > > differs from the

Re: [Bug] git-log prints wrong unixtime with --date=format:%s

2016-05-17 Thread Michael Heerdegen
Michael Heerdegen writes: > the command > >git log --pretty=format:%ad --date=format:%s > > displays wrong unixtime values; apparently how much the printed value > differs from the expected value depends on the system's time zone and > whether daylight savings time