Re: [PATCH 2/2] pretty=format: Add %d to show decoration

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: René Scharfe
Date: Wednesday, April 9, 2008 - 2:40 pm

Johannes Schindelin schrieb:

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.


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é
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/2] decorate: use "const struct object", Johannes Schindelin, (Mon Apr 7, 6:40 am)
[PATCH 2/2] pretty=format: Add %d to show decoration, Johannes Schindelin, (Mon Apr 7, 6:41 am)
Re: [PATCH 2/2] pretty=format: Add %d to show decoration, René Scharfe, (Wed Apr 9, 2:40 pm)
Re: [PATCH 2/2] pretty=format: Add %d to show decoration, Junio C Hamano, (Thu Apr 10, 1:39 am)