Junio C Hamano wrote:
> If you are saying, by after each token, that
> --format='%(color:blue)%(A)literal string%(B)'
> should result in
> <color blue> <value for A> <color reset> "literal string" <value for
> then I would disagree.
Hm, I didn't think it was a bad idea to reset after each token. The
whole point of having color is to make sure that two consecutive
tokens don't have the same color, no? Then again, my scheme would
result in extra unnecessary resets like
being turned into:
Here, the first %(color:reset) is completely unnecessary.
> I was suggesting it to instead produce
> <color blue> <value for A> "literal string" <value for B> <color
> where the <color reset> always comes when some color is used and we
> hit the end of the format string. A bonus point if we can make it so
> that we emit the final reset only when the last "%(color:some)" is
> not "%(color:reset)", but unconditional "reset if we ever used
> color" is fine.
Okay, a simple don't-leak-color. I'll submit another iteration soon.
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html