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

Re: [PATCH 0/4] fix a leak with excludes_file

From
Rubén Justo <rjusto@gmail.com>
Date
Apr 8, 2024, 19:33 UTC
Message-ID
<89a2db74-2bb6-4c62-ad8a-bc4fe5fe49fa@gmail.com>
In-Reply-To
<xmqqy19nbvtt.fsf@gitster.g>
On Mon, Apr 08, 2024 at 10:36:30AM -0700, Junio C Hamano wrote:
Show 9 quoted lines
> Rubén Justo <rjusto@gmail.com> writes:
> 
> > It does not have to be like that.  We may no longer need the current
> > and problematic git_config_pathname().  However I did not want to go
> > that far in this series.
> 
> True, but that one and only true interface we will end up with MUST
> NOT be strbuf based one, and that is why I said the patch as posted
> will not take us into a better future.
It doesn't have to be having a strbuf-based-only interface, either.
It is about introducing an interface where callers:
	- can take advantage of a not-always-allocate interface, and
	- can stop worrying about freeing previous values, when reusing
	  variables.

This latter fixes the leak while the former introduces a nice "if you set n-times the same value, we'll allocate once".

Previous: Junio C Hamano
Message 9 of 9 in “fix a leak with excludes_file”
  1. 0/4 fix a leak with excludes_fileRubén Justo, Apr 6, 2024
  2. 1/4 path.c: introduce strbuf_interpolate_pathRubén Justo, Apr 6, 2024
  3. 2/4 config.c: introduce git_config_strbuf_pathnameRubén Justo, Apr 6, 2024
  4. 3/4 environment.c: convert excludes_file to struct strbufRubén Justo, Apr 6, 2024
  5. 4/4 t7300: mark as leak-freeRubén Justo, Apr 6, 2024
  6. Junio C HamanoApr 6, 2024
  7. Rubén JustoApr 7, 2024
  8. Junio C HamanoApr 8, 2024
  9. Rubén JustoApr 8, 2024

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.