From: René Scharfe Date: Wed, 09 Apr 2008 21:40:38 GMT Subject: Re: [PATCH 2/2] pretty=format: Add %d to show decoration Message-ID: <47FD37D6.2030506@lsrfire.ath.cx> In-Reply-To: Johannes Schindelin schrieb: > With this patch, "git log --decorate --pretty=format:%d", shows the > name decoration (i.e. whenever a commit matches a ref, that ref's > name is shown). Cute idea. :) What about objects with multiple decoration? How about producing a comma-separated list like git-log does? How about making %d imply --decorate? You could load the decorations lazily when it's first encountered. > Maybe %d should expand to " ()" instead of " decoration>"? foobar2000 (http://foobar2000.org/) has a kind of music tagging language, and one of its features might be interesting for us here: you can group a placeholder and other stuff inside brackets. The construct resolves to an empty string if the placeholder is NULL, i.e. in your example "[ (%d)]" would resolve to either " (the decoration)" or "", depending on the object having a decoration or not. (It might be a better fit for --pretty=format: to use %[ and %].) By the way, your patch reminds me that I wanted to add a placeholder for git-describe's output. I doubt I'll find time for that in the near future, though.. René