git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [JGIT PATCH] Expose the raw timezone offset from PersonIdent

From
Shawn O. Pearce <spearce@spearce.org>
Date
Sep 6, 2008, 19:27 UTC
Message-ID
<20080906192727.GC18631@spearce.org>
In-Reply-To
<200809061705.56879.robin.rosenberg.lists@dewire.com>
Robin Rosenberg <robin.rosenberg.lists@dewire.com> wrote:
Show 7 quoted lines
> fredagen den 5 september 2008 03.37.19 skrev Shawn O. Pearce:
> > Applications may wish to have this value, much as they
> > can get the raw seconds-since-epoch and reformat it
> > for their own uses.
> 
> Necessary (performance) or just nice? We already provide the
> timezone in java.util format.

It isn't necessary from a performance perspective, but is required to read the commit data exactly, but in parsed form.

What I'm doing at the application level is taking a RevCommit and converting it into a different data structure (more specifically a Google Protocol Buffer) that has all of the parts broken out. It looks like this:

  message GitPerson {
    required string name = 1;
    required string email = 2;
    required int32 when = 3;
    required int32 tz = 4;
  }
  
  message GitCommit {
    required string id = 1;
    repeated string parent_id = 2;
    required GitPerson author = 3;
    optional GitPerson committer = 4;
    optional string message = 5;
  }

I'm later processing the GitPerson in Python and need to use the tz to offset when to format a time for display. If the author has a "funny" offset in their commit our existing getTimeZone() method can return null, which means I have to then lie and send 0 to the Python code. I'd rather send the exact offset.

-- 
Shawn.
Previous: Robin Rosenberg
Message 3 of 3 in “Expose the raw timezone offset from PersonIdent”
  1. Expose the raw timezone offset from PersonIdentShawn O. Pearce, Sep 5, 2008
  2. Robin RosenbergSep 6, 2008
  3. Shawn O. PearceSep 6, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.