{"thread":{"id":"253","subject":"Re: git pull on ia64 linux tree","startedAt":"2005-04-22T22:34:32Z","lastAt":"2005-04-24T05:02:46Z","messageCount":2,"participants":["Linus Torvalds","Sanjoy Mahajan"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"1337","messageId":"Pine.LNX.4.58.0504221521260.2344@ppc970.osdl.org","threadId":"253","inReplyTo":"200504222203.j3MM3fV17003@unix-os.sc.intel.com","subject":"Re: git pull on ia64 linux tree","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-04-22T22:34:32Z","receivedAt":"2005-04-22T22:34:32Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 22 Apr 2005 tony.luck@intel.com wrote:\n> \n> \"git log\" seems to have problems interpreting the dates ... looking at the\n> commit entries, the time is right ... but it appears that git log applies\n> the timezone correction twice, so the changes I just applied at 14:46 PDT\n> look like I made them at quarter to five tomorrow morning (+14 hours from\n> when I did).\n\nLooks like you are right.\n\nThe seconds are already in UTC format, so I think \"git log\" is wrong to \npass the UTC seconds in to \"date\", and then tell date that it was done in \nthe original timezone.\n\nI think it would be nice to use the TZ data to show the thing in the \ntimezone of the committer, though. Dunno how to do that, maybe something \nlike\n\n\tTZ=$tz date -d \"1970-01-01 + $sec sec\"\n\nor whatever. Sadly, it looks like \"date\" doesn't understand timezone \nsyntax like that - looks like TZ has to be in the long machine-unreadable \nformat like \"US/Pacific\" etc. Stupid (either TZ or me - maybe I just \ndon't know what the right format is).\n\n\t\tLinus\n"},{"id":"1487","messageId":"E1DPZGY-0000VJ-00@skye.ra.phy.cam.ac.uk","threadId":"253","inReplyTo":"Pine.LNX.4.58.0504221521260.2344@ppc970.osdl.org","subject":"Re: git pull on ia64 linux tree","fromName":"Sanjoy Mahajan","fromEmail":"sanjoy@mrao.cam.ac.uk","sentAt":"2005-04-24T05:02:46Z","receivedAt":"2005-04-24T05:02:46Z","isPatch":false,"sender":{"key":"sanjoy@mrao.cam.ac.uk","avatar":null},"body":"> I think it would be nice to use the TZ data to show the thing in the\n> timezone of the committer, though. Dunno how to do that, maybe\n> something like\n>\tTZ=$tz date -d \"1970-01-01 + $sec sec\"\n> Sadly, it looks like \"date\" doesn't understand timezone syntax like\n> that\n\nTry:\n\nnegzone=`echo $tz | tr '[-]+' '+-'`\ndate -u -R -d \"1970-01-01 $negzone + $sec sec\" | sed \"s/+0000/$tz/\"\n\nOr as a script:\n\n#!/bin/bash\n# usage: show-date.sh <utcseconds> <zone>\nnegzone=`echo $2 | tr '[-]+' '+-'`\ndate -u -R -d \"1970-01-01 $negzone + $1 sec\" | sed \"s/+0000/$2/\"\n\nA simple test:\n\n$ show-date.sh 10 +0200\nThu, 01 Jan 1970 02:00:10 +0200\n\nNegating the timezone is an ugly workaround for date not understanding\na sensible TZ format.  I almost always use -u with date, otherwise I\nget confused about what timezone it is using to interpret and to print\nthe date.\n\n-Sanjoy\n"}]}