Subject: Re: --no-decorate and %d in git-log(1)

From: Alejandro Colomar <[email-masked]>
Date: Wed, 25 Feb 2026 19:36:24 +0100

Hi Junio,

On 2026-02-25T10:29:12-0800, Junio C Hamano wrote:
> Alejandro Colomar <[email-masked]> writes:
> 
> > Would you mind changing %d to be affected by --decorate=?
> 
> I would imagine everybody would strongly mind as the scripts they
> have already written and have been using for years will be broken by
> such a change.  So changing how %d works is a non-starter.

Makes sense.

> 
> But that does not mean we cannot add a different placeholder that
> behaves that way.  I wonder if it is the cleanest to extend the
> %(decoreate:<option>,...) notation, perhaps like
> 
>     $ git log --format="%(decorate:optional=yes)"
> 
> with and without --decorate/--no-decorate may be a way forward?

That could work for me.

Alternatively, we could add another level to --decorate=.  Currently,
there are --decorate[=(short|full|auto|no)].  We could add 'never' to
also exclude %d.

What do you think?

Cheers,
Alex

-- 
<https://www.alejandro-colomar.es>