git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] use strbuf_addstr() for adding constant strings to a strbuf, part 2

From
Jeff King <peff@peff.net>
Date
Sep 15, 2016, 19:38 UTC
Message-ID
<20160915193804.d2mmmeard2rj6vye@sigill.intra.peff.net>
In-Reply-To
<xmqqbmzpnex4.fsf@gitster.mtv.corp.google.com>
On Thu, Sep 15, 2016 at 12:25:43PM -0700, Junio C Hamano wrote:
Show 8 quoted lines
> >> Silly question: Is there a natural language that uses percent signs
> >> as letters or e.g. instead of commas? :)
> >
> > I don't know, but if they do, they'd better get used to escaping them.
> > :)
> 
> I do not know either, but I am curious where that question comes
> from.  I stared at this patch for a few minutes but couldn't guess.

My initial thought is that the next step after picking this low-hanging fruit would be to find cases where the strings do not contain "%", and thus we do not have to care about formatting. But a case like:

  strbuf_addf(&buf, "this does not have any percents!", foo);

is simply broken (albeit in a way that we ignore foo, so it's just ugly code, not a real bug).

So I dunno. I too am curious.
-Peff
Previous: Junio C HamanoNext: René Scharfe
Message 4 of 10 in “use strbuf_addstr() for adding constant strings to a strbuf, part 2”
  1. use strbuf_addstr() for adding constant strings to a strbuf, part 2René Scharfe, Sep 15, 2016
  2. Jeff KingSep 15, 2016
  3. Junio C HamanoSep 15, 2016
  4. Jeff KingSep 15, 2016
  5. René ScharfeSep 15, 2016
  6. Junio C HamanoSep 15, 2016
  7. René ScharfeSep 15, 2016
  8. Junio C HamanoSep 15, 2016
  9. René ScharfeOct 2, 2016
  10. brian m. carlsonSep 15, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.