Re: [PATCH v2 09/10] pretty: implement 'summary' format
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 10, 2019, 06:25 UTC
- Message-ID
- <xmqqftiwl02i.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <08afdbcd-5972-05f9-ec8c-b12bd29d9030@web.de>
René Scharfe <l.s.r@web.de> writes:
Show 8 quoted lines
> Hmm, that's quite a lot of code to add to the formatting code with its
> repeated special-case checks. Why not implement it as a built-in user
> format, like making it an alias for something like this?
>
> git log --format='%C(auto)%h ("%s", %as)'
>
> We don't have %as, yet, but making --date=short available as a
> placeholder would be a good idea anyway (patch below).Yes! Implementing the 'summary' internally as merely an alias to a canned user format does sound like the right approach.
Further, instead of inventing %as, I think you could just use %ad there, and when 'summary' uses that canned user format, flip the default date format to short.
That way, "git show -s --pretty=summary --date=iso" would be available to those who like the format.
Thanks.