git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Robin Rosenberg <robin.rosenberg.lists@dewire.com>
Cc: git@vger.kernel.org
Subject: Re: [JGIT PATCH] Expose the raw timezone offset from PersonIdent
Date: Sat, 6 Sep 2008 12:27:27 -0700	[thread overview]
Message-ID: <20080906192727.GC18631@spearce.org> (raw)
In-Reply-To: <200809061705.56879.robin.rosenberg.lists@dewire.com>

Robin Rosenberg <robin.rosenberg.lists@dewire.com> wrote:
> 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.

      reply	other threads:[~2008-09-06 19:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-05  1:37 [JGIT PATCH] Expose the raw timezone offset from PersonIdent Shawn O. Pearce
2008-09-06 15:05 ` Robin Rosenberg
2008-09-06 19:27   ` Shawn O. Pearce [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080906192727.GC18631@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=robin.rosenberg.lists@dewire.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).