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

Re: [PATCHv3 2/2] builtin/commit.c: switch to xstrfmt(), instead of snprintf,

From
Jeff King <peff@peff.net>
Date
Jan 14, 2017, 18:08 UTC
Message-ID
<20170114180818.wrnltwwlypjmiuh3@sigill.intra.peff.net>
In-Reply-To
<3165803b-6073-de97-bf33-71ad21108d6f@web.de>
On Sat, Jan 14, 2017 at 05:31:39PM +0100, René Scharfe wrote:
> Perhaps I missed it from the discussion, but why not use strbuf?  It
> would avoid counting the generated string's length.  That's probably
> not going to make a measurable difference performance-wise, but it's
> easy to avoid and doesn't even take up more lines:

It was mentioned in the review of the very first patch, but I think it just got dropped. I agree the strbuf way is nicer (not because of efficiency, but because it's simply easier to read and follow).

-Peff
Previous: René Scharfe
Message 8 of 8 in “[PATCHv3 1/2] builtin/commit.c: removes the PATH_MAX limitation via dynamic allocation”
  1. Elia PintoJan 13, 2017
  2. 2/2 builtin/commit.c: switch to xstrfmt(), instead of snprintf,Elia Pinto, Jan 13, 2017
  3. Brandon WilliamsJan 13, 2017
  4. Elia PintoJan 14, 2017
  5. Junio C HamanoJan 15, 2017
  6. Elia PintoJan 15, 2017
  7. René ScharfeJan 14, 2017
  8. Jeff KingJan 14, 2017

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.