Re: [PATCH 2/3] strbuf: add strbuf_percentquote_buf
- From
Jeff King <peff@peff.net>
- Date
- Jan 12, 2010, 16:18 UTC
- Message-ID
- <20100112161859.GA5649@coredump.intra.peff.net>
- In-Reply-To
- <alpine.DEB.1.00.1001121718210.4985@pacific.mpi-cbg.de>
On Tue, Jan 12, 2010 at 05:19:21PM +0100, Johannes Schindelin wrote:
Show 6 quoted lines
> > This is handy for creating strings which will be fed to > > strbuf_expand or printf. > > For printf(), there is always %s%s, so I would not say your patch is > useful there, but rather adds churn: first you add a percent, then you > strip it away again.
True. It is only useful in either case if you are going to pass the format specifier through an API that does all of its work at once (e.g., in this instance, I would be happy to simply output my strings at the right moment, but I need to get them _between_ the log format and the diff summary, which means I need to hide them in the log format specifier). That tends not to happen with printf-style strings, since we don't build complex APIs around them.
-Peff