From: "SZEDER Gábor" <szeder@ira.uka.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] pretty: add format specifiers for short and raw date formats
Date: Thu, 08 Oct 2015 13:04:26 +0200 [thread overview]
Message-ID: <20151008130426.Horde.ovF3CHaJ-fo48aLDf23t-Q1@webmail.informatik.kit.edu> (raw)
In-Reply-To: <xmqqmvvutone.fsf@gitster.mtv.corp.google.com>
Quoting Junio C Hamano <gitster@pobox.com>:
> SZEDER Gábor <szeder@ira.uka.de> writes:
>
>> @@ -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?
Sort of. There is 'local', but after add00ba2de (date: make "local"
orthogonal to date format, 2015-09-03) hit master that's not a
format anymore.
> 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.
> *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:...)".
That would be great, especially that in [*1*]. Real words are so
much better than one or two letter codes.
Of course that would also be a lot more invasive change.
> *2* Because we have "%ad", we _can_ stop adding new ones already.
With this patch in my tree I have this pretty alias
pretty.commitref=tformat:%h (%s, %as)
in my config, and a simple '--pretty=commitref' option works on its
own to produce the format that I used above. With '%ad' that
wouldn't work, because I would need the additional '--date=short'
option, too, which means I have to remember it and have to type more
every time.
Gábor
prev parent reply other threads:[~2015-10-08 11:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-07 16:28 [PATCH] pretty: add format specifiers for short and raw date formats SZEDER Gábor
2015-10-07 20:22 ` Junio C Hamano
2015-10-08 11:04 ` SZEDER Gábor [this message]
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=20151008130426.Horde.ovF3CHaJ-fo48aLDf23t-Q1@webmail.informatik.kit.edu \
--to=szeder@ira.uka.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).