On Fri, Aug 02, 2019 at 02:20:31PM -0700, Junio C Hamano wrote: > > This would require that higher level to parse the user format to check > > if %d or %D is present before formatting the first item. Hmm. > > Yes. Don't we pre-scan what kind of formatting primitives are used > in the end-user supplied string already to optimize loading of notes > and source information? I think userformat_find_requirements() is what you're looking for. I do think it might be tricky to find all of the callers who need to use it, though. Some of them are not necessarily users of the traversal machinery, but just have a one-off pretty_print_context. -Peff