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

Re: [PATCH] builtin-tag.c: remove global variable to use the callback data of git-config.

From
CRCarlos Rica <jasampler@gmail.com>
Date
Mar 16, 2009, 11:46 UTC
Message-ID
<1b46aba20903160446y34bf106ai100b8231a54699ab@mail.gmail.com>
In-Reply-To
<7vprgjakpz.fsf@gitster.siamese.dyndns.org>
On Sat, Mar 14, 2009 at 9:54 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> Carlos Rica <jasampler@gmail.com> writes:
>
>> Signed-off-by: Carlos Rica <jasampler@gmail.com>
>> ---
>>
>> Here I declare a struct to wrap the new local array along with its size.
>> QUESTION: An alternative to this is strbuf, would it be preferable?
>
> The command already uses strbuf for other purposes, so why not?

strbuf is designed as an unlimited length buffer, and now the user signing-key id (obtained from the config or as a command's argument) is limited to the current static array size.

It is right to remove this limit? I haven't found something like strlcpy for strbuf and I'm not sure if it would be a nice adition:

size_t strbuf_lcpy(struct strbuf *dest,
        const char *src,  size_t max);
Previous: Junio C Hamano
Message 3 of 3 in “builtin-tag.c: remove global variable to use the callback data of git-config.”
  1. builtin-tag.c: remove global variable to use the callback data of git-config.Carlos Rica, Mar 14, 2009
  2. Junio C HamanoMar 14, 2009
  3. Carlos RicaMar 16, 2009

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.