Re: [PATCH v4 2/7] pretty: allow %(trailers) options with explicit value
- From
Anders Waldenborg <anders@0x63.nu>
- Date
- Jan 29, 2019, 21:23 UTC
- Message-ID
- <87pnsfkvk1.fsf@0x63.nu>
- In-Reply-To
- <20190129165523.GA7349@sigill.intra.peff.net>
Jeff King writes:
> There's some small value in leaving > %X alone if we do not understand "X" (not to mention the backwards > %compatibility you mentioned), but I think %() is a pretty > deliberate indication that a placeholder was meant there.
Good point.
Show 8 quoted lines
> We already do this for ref-filter expansions: > > $ git for-each-ref --format='%(foo)' > fatal: unknown field name: foo > > We don't for "--pretty" formats, but I do wonder if anybody would be > really mad (after all, we have declared ourselves free to add new > placeholders, so such formats are not future-proof).
Oh my. I wasn't aware that there was a totally separate string interpolation implementation used for ref filters. That one has separated parsing, making it more amenable to good error handling. I wonder if that could be generalized and reused for pretty formats.
However I doubt I will have time to dig deeper into that in near time.