git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Andreas Schwab <schwab@linux-m68k.org>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [ANNOUNCE] Git v2.9.1
Date: Tue, 12 Jul 2016 11:35:20 -0400	[thread overview]
Message-ID: <20160712153520.GG613@sigill.intra.peff.net> (raw)
In-Reply-To: <CAPc5daWcb5bfgsxMP0vCrQ7gBdeYBgefzPNHztaaCKzqbCv2aQ@mail.gmail.com>

On Tue, Jul 12, 2016 at 08:25:51AM -0700, Junio C Hamano wrote:

> On Tue, Jul 12, 2016 at 8:16 AM, Jeff King <peff@peff.net> wrote:
> >>
> >> But moving the internal time representation used in various fields
> >> like commit->date to time_t is likely to be a wrong thing to do,
> >> because the first problem with "unsigned long", i.e. "may not be
> >> wide enough", is not limited to "not wide enough to hold time_t".
> >> It also includes "it may not be wide enough to hold time somebody
> >> else recorded in existing objects".
> >
> > But that's a problem no matter what size we choose.
> 
> Yes, if somebody's time_t is larger than my intmax_t, the problem
> cannot be solved for me, if that timestamp is too far in the future or
> in the past.

I am less worried about their time_t and more about whatever crap they
write in ascii into their objects. :)

> But that is not the problem I am pointing out. I heard earlier in the
> thread that time_t on one system was 32-bit (was it Linux?) but I think
> they have "long long". Choosing time_t is strictly inferior choice when
> we already know that a platform with not-wide-enough time_t need to
> be supported, and a type that is wider than that is available.

I am not certain that there is a modern system with 32-bit time_t. We
know there are systems with 32-bit unsigned long, and I think that is
what produced the results people saw. I'd expect even 32-bit systems to
use "int64_t" or similar for their time_t these days.

I'm also not convinced that we would be helping much to carry around a
wider gittime_t. Most of the display code ends up touching a system time
function one way or another, so I find it unlikely it would produce much
better output.

It would help for simple cases like commit->date where we really do just
parse it into a number and never do more with it. But...

> I was envisioning that we would have typedef <sometime> gittime_t
> with conversion helpers between it and time_t that allow us to do some
> range checks while at it.

I guess I am just willing to trust that time_t is basically that. And if
your platform has a grossly undersized time_t, then too bad, we clamp
everything it can't hold to 2038 or whatever, and hopefully your
terrible platform dies out or gets a clue sometime in the next 20 years.

-Peff

  reply	other threads:[~2016-07-12 15:35 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-11 20:13 [ANNOUNCE] Git v2.9.1 Junio C Hamano
2016-07-11 21:35 ` Andreas Schwab
2016-07-11 23:54   ` Jeff King
2016-07-12  0:40     ` Anders Kaseorg
2016-07-12 14:06       ` Jeff King
2016-07-12  0:56     ` Eric Wong
2016-07-12  1:15       ` Jeff King
2016-07-12  1:59     ` Junio C Hamano
2016-07-12  3:57       ` Jeff King
2016-07-12 15:55         ` Junio C Hamano
2016-07-12  7:30       ` Johannes Schindelin
2016-07-12  7:39         ` Jeff King
2016-07-12 11:25           ` Johannes Schindelin
2016-07-12 14:04             ` Jeff King
2016-07-13 11:35               ` Johannes Schindelin
2016-07-13 16:03                 ` Junio C Hamano
2016-07-13 19:10                   ` Johannes Schindelin
2016-07-13 19:41                     ` Junio C Hamano
2016-07-14  7:50                       ` Johannes Schindelin
2016-07-12 18:12             ` Junio C Hamano
2016-07-13  1:53               ` Junio C Hamano
2016-07-13  2:01               ` Jeff King
2016-07-13 16:05                 ` Junio C Hamano
2016-07-13 18:52                   ` Johannes Schindelin
2016-07-13 19:07                     ` Junio C Hamano
2016-07-14  7:45                       ` Johannes Schindelin
2016-07-14  8:01                         ` Andreas Schwab
2016-07-14  8:15                         ` Jeff King
2016-07-14 16:06                       ` Johannes Schindelin
2016-07-12  7:40         ` Andreas Schwab
2016-07-12 10:57           ` Johannes Schindelin
2016-07-12 13:00             ` Andreas Schwab
2016-07-12 13:22               ` Johannes Schindelin
2016-07-12 13:31                 ` Andreas Schwab
2016-07-12 13:46                   ` Jeff King
2016-07-12 18:38                     ` Duy Nguyen
2016-07-13 11:29                       ` Johannes Schindelin
2016-07-13 11:25                   ` Johannes Schindelin
2016-07-12 14:34         ` Junio C Hamano
2016-07-12 15:16           ` Jeff King
2016-07-12 15:25             ` Junio C Hamano
2016-07-12 15:35               ` Jeff King [this message]
2016-07-12 15:41                 ` Junio C Hamano
2016-07-12 16:09                   ` Jeff King
2016-07-12 16:25                     ` Junio C Hamano
2016-07-13 14:00                       ` Johannes Schindelin
2016-07-13 16:10                         ` Junio C Hamano
2016-07-13 18:53                           ` Johannes Schindelin
2016-07-12 18:15                     ` Andreas Schwab
2016-07-13 20:43       ` Junio C Hamano
2016-07-14  7:38         ` Lars Schneider
2016-07-16  5:50           ` Duy Nguyen
2016-07-14  7:58         ` 32-bit Travis, was " Johannes Schindelin
2016-07-14  9:12           ` Mike Hommey
2016-07-14 10:58             ` Johannes Schindelin
2016-07-15  1:59               ` Mike Hommey

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20160712153520.GG613@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=schwab@linux-m68k.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).