All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rubén Justo" <rjusto@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH 0/4] fix a leak with excludes_file
Date: Mon, 8 Apr 2024 21:33:50 +0200	[thread overview]
Message-ID: <89a2db74-2bb6-4c62-ad8a-bc4fe5fe49fa@gmail.com> (raw)
In-Reply-To: <xmqqy19nbvtt.fsf@gitster.g>

On Mon, Apr 08, 2024 at 10:36:30AM -0700, Junio C Hamano wrote:
> 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".

      reply	other threads:[~2024-04-08 19:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-06 14:29 [PATCH 0/4] fix a leak with excludes_file Rubén Justo
2024-04-06 14:31 ` [PATCH 1/4] path.c: introduce strbuf_interpolate_path Rubén Justo
2024-04-06 14:32 ` [PATCH 2/4] config.c: introduce git_config_strbuf_pathname Rubén Justo
2024-04-06 14:32 ` [PATCH 3/4] environment.c: convert excludes_file to struct strbuf Rubén Justo
2024-04-06 14:32 ` [PATCH 4/4] t7300: mark as leak-free Rubén Justo
2024-04-06 17:53 ` [PATCH 0/4] fix a leak with excludes_file Junio C Hamano
2024-04-07 17:48   ` Rubén Justo
2024-04-08 17:36     ` Junio C Hamano
2024-04-08 19:33       ` Rubén Justo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=89a2db74-2bb6-4c62-ad8a-bc4fe5fe49fa@gmail.com \
    --to=rjusto@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.