Re: [PATCH v2] pretty: Provide a strict ISO8601 date format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 29, 2014 at 11:02:36PM +0200, Beat Bolli wrote:

> On 29.08.14 20:59, Junio C Hamano wrote:
> >> +# ISO strict date format
> >> +test_expect_success 'ISO and ISO-strict date formats display the same values' '
> >> +	git log --format=%ai%n%ci | sed -e "s/ /T/; s/ //; s/..\$/:&/" >expected &&
> >> +	git log --format=%aI%n%cI >actual &&
> >> +	test_cmp expected actual
> >> +'
> > 
> > This is saying that as long as --date=iso-strict format is
> > bug-to-bug compatible with --date=iso format it is OK.
> > 
> > Which is fine, especially knowing the implementation ;-)
> > 
> 
> Yeah, I wasn't sure how to test this, since the commit dates change with
> each test run. Maybe it's the easy way out, but on the other hand it's
> better than no test at all. Check the known parts with a regex?

If you use test_tick (or test_commit, which calls it), the timestamps
are stable from run to run of the tests.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]