From: Junio C Hamano <gitster@pobox•com>
To: Beat Bolli <bbolli@ewanet•ch>
Cc: git@vger•kernel.org
Subject: Re: [PATCH v2] pretty: Provide a strict ISO8601 date format
Date: Fri, 29 Aug 2014 11:59:12 -0700 [thread overview]
Message-ID: <xmqqwq9r5dhb.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1409331522-8457-1-git-send-email-bbolli@ewanet.ch> (Beat Bolli's message of "Fri, 29 Aug 2014 18:58:42 +0200")
Beat Bolli <bbolli@ewanet•ch> writes:
> Subject: Re: [PATCH v2] pretty: Provide a strict ISO8601 date format
"pretty: add --date=iso-strict, a strict ISO-8601 date format"
> The differences between the two formats are the following:
"The --date=iso format Git uses deviates from ISO-8601 in these
ways" may make it clear which one has "T" and which doesn't.
> - a space instead of the `T` date/time delimiter
> - a space between time and time zone
> - no colon between hours and minutes of the time zone
> This commit adds a strict ISO 8601 date format for displaying committer
> and author dates. It uses the '%aI' and '%cI' format specifiers (note
> the uppercase 'I') and the '--date=iso-strict' or
> '--date=iso8601-strict' date format names.
"Add a .... author dates. Use '%aI' and '%cI' format specifiers ...".
> See http://thread.gmane.org/gmane.comp.version-control.git/255879 and
> http://thread.gmane.org/gmane.comp.version-control.git/52414/focus=52585
> for discussion.
Thanks for the pointers, especially for the older one.
> + else if (mode == DATE_ISO8601_STRICT) {
> + char sign = (tz >= 0) ? '+' : '-';
> + tz = abs(tz);
> + strbuf_addf(&timebuf, "%04d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d",
> + tm->tm_year + 1900,
> + tm->tm_mon + 1,
> + tm->tm_mday,
> + tm->tm_hour, tm->tm_min, tm->tm_sec,
> + sign, tz / 100, tz % 100);
OK.
> +# 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 ;-)
> +
> # get new digests (with no abbreviations)
> head1=$(git rev-parse --verify HEAD~0) &&
> head2=$(git rev-parse --verify HEAD~1) &&
next prev parent reply other threads:[~2014-08-29 18:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-29 16:58 [PATCH v2] pretty: Provide a strict ISO8601 date format Beat Bolli
2014-08-29 18:59 ` Junio C Hamano [this message]
2014-08-29 19:04 ` Junio C Hamano
2014-08-29 19:34 ` Andreas Schwab
2014-08-29 21:30 ` Beat Bolli
2014-08-29 21:02 ` Beat Bolli
2014-08-29 22:12 ` Jeff King
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqwq9r5dhb.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=bbolli@ewanet$(echo .)ch \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox