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

[PATCH 0/3] fix local_tzoffset with far-in-future dates

From
Jeff King <peff@peff.net>
Date
Jun 20, 2016, 21:09 UTC
Message-ID
<20160620210901.GE3631@sigill.intra.peff.net>
In-Reply-To
<20160620200011.GC3631@sigill.intra.peff.net>
On Mon, Jun 20, 2016 at 04:00:12PM -0400, Jeff King wrote:
Show 10 quoted lines
> You _should_ be able to get the right answer by asking git for
> --date=local, but it doesn't seem to work. Looks like it is because our
> tm_to_time_t hits this code:
> 
>   if (year < 0 || year > 129) /* algo only works for 1970-2099 */
> 	return -1;
> 
> and the caller does not actually check the error. The resulting timezone
> is the screwed-up -40643156, which is perhaps how it got into the commit
> in the first place.

So here's a patch to fix that (along with some test infrastructure to support it). I still don't know how that screwed-up timestamp got _into_ a commit, so perhaps there is another bug lurking. I couldn't convince git to parse anything beyond 2100, and committing with GIT_AUTHOR_DATE='@5758122296 +0000' works just fine.

  [1/3]: t0006: rename test-date's "show" to "relative"
  [2/3]: t0006: test various date formats
  [3/3]: local_tzoffset: detect errors from tm_to_time_t
-Peff
Next: Jeff King
Message 1 of 8 in “fix local_tzoffset with far-in-future dates”
  1. 0/3 fix local_tzoffset with far-in-future datesJeff King, Jun 20, 2016
  2. 2/3 t0006: test various date formatsJeff King, Jun 20, 2016
  3. 3/3 local_tzoffset: detect errors from tm_to_time_tJeff King, Jun 20, 2016
  4. 1/3 t0006: rename test-date's "show" to "relative"Jeff King, Jun 20, 2016
  5. Junio C HamanoJun 20, 2016
  6. Jeff KingJun 20, 2016
  7. Norbert KieselJun 21, 2016
  8. Jeff KingJun 21, 2016

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.