Re: [PATCH 5/5] log: do not segfault on gmtime errors
- From
Jeff King <peff@peff.net>
- Date
- Mar 26, 2014, 19:01 UTC
- Message-ID
- <20140326190157.GB12912@sigill.intra.peff.net>
- In-Reply-To
- <xmqqvbv0iy6u.fsf@gitster.dls.corp.google.com>
On Wed, Mar 26, 2014 at 11:58:49AM -0700, Junio C Hamano wrote:
Show 15 quoted lines
> > Unlike the FreeBSD thing that René brought up, this is not a problem in > > the code, but just in the test. So I think our options are basically: > > > > 1. Scrap the test as unportable. > > > > 2. Hard-code a few expected values. I'd be unsurprised if some other > > system comes up with a slightly different date in 162396404, so we > > may end up needing several of these. > > > > I think I'd lean towards (2), just because it is testing an actual > > feature of the code, and I'd like to continue doing so. And while we may > > end up with a handful of values, there's probably not _that_ many > > independent implementations of gmtime in the wild. > > Or "3. Just make sure that 'git log' does not segfault"?
That would not test the FreeBSD case, which does not segfault, but returns a bogus sentinel value.
I don't know how important that is. This is such a minor feature that it is not worth a lot of maintenance headache in the test. But I also do not know if this is going to be the last report, or we will have a bunch of other systems that need their own special values put into the test.
-Peff