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

Re: [PATCH] pretty: add format specifiers for short and raw date formats

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 7, 2015, 20:22 UTC
Message-ID
<xmqqmvvutone.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1444235305-8718-1-git-send-email-szeder@ira.uka.de>
SZEDER Gábor <szeder@ira.uka.de> writes:
Show 6 quoted lines
> @@ -120,6 +120,8 @@ The placeholders are:
>  - '%at': author date, UNIX timestamp
>  - '%ai': author date, ISO 8601-like format
>  - '%aI': author date, strict ISO 8601 format
> +- '%as': author date, short format
> +- '%aR': author date, raw format
Hmmm, are these two a good things the only ones that are missing?

It makes me wonder if it's time for us to move to a more extensible format, e.g. "%aT(...)", in which 'T' stands for 'timestamp' and the part in the parentheses can be any format string that is understood by "log --date=<format>" [*1*]. Once we have something like that, we can keep the existing ones for historical convenience, stop adding new ones [*2*] and do not have to worry about these two mechanisms going out of sync.

Also, "%at" is almost there as a replacement for "%aR"; what we are missing really is "%aZ" for zone offset. If we had "%aZ", we do not need "%aR", as that is "%at %aZ".

[Footnote]
*1* Yes, and in longer term, we should really aim to unify the
    for-each-ref format and "--pretty=format:" format.  "%aT(...)"
    is probably a step in a wrong direction, and it should probably
    be more like "%(authordate:...)".
*2* Because we have "%ad", we _can_ stop adding new ones already.
Previous: SZEDER GáborNext: SZEDER Gábor
Message 2 of 3 in “pretty: add format specifiers for short and raw date formats”
  1. pretty: add format specifiers for short and raw date formatsSZEDER Gábor, Oct 7, 2015
  2. Junio C HamanoOct 7, 2015
  3. SZEDER GáborOct 8, 2015

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.