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

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

From
Jeff King <peff@peff.net>
Date
Aug 29, 2014, 22:12 UTC
Message-ID
<20140829221206.GB24834@peff.net>
In-Reply-To
<5400EA6C.3030504@ewanet.ch>
On Fri, Aug 29, 2014 at 11:02:36PM +0200, Beat Bolli wrote:
Show 17 quoted lines
> 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
Previous: Beat Bolli
Message 7 of 7 in “pretty: Provide a strict ISO8601 date format”
  1. pretty: Provide a strict ISO8601 date formatBeat Bolli, Aug 29, 2014
  2. Junio C HamanoAug 29, 2014
  3. Junio C HamanoAug 29, 2014
  4. Andreas SchwabAug 29, 2014
  5. Beat BolliAug 29, 2014
  6. Beat BolliAug 29, 2014
  7. Jeff KingAug 29, 2014

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.