git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "René Scharfe" <l.s.r@web.de>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH] rebase: use strvec_pushf() for format-patch revisions
Date: Wed, 20 Dec 2023 07:57:13 -0800	[thread overview]
Message-ID: <xmqqmsu4uasm.fsf@gitster.g> (raw)
In-Reply-To: <47089803-c45b-4f33-b542-146c313f0902@web.de> ("René Scharfe"'s message of "Wed, 20 Dec 2023 09:04:35 +0100")

René Scharfe <l.s.r@web.de> writes:

> Am 19.12.23 um 18:12 schrieb Junio C Hamano:
>> René Scharfe <l.s.r@web.de> writes:
>>
>>> In run_am(), a strbuf is used to create a revision argument that is then
>>> added to the argument list for git format-patch using strvec_push().
>>> Use strvec_pushf() to add it directly instead, simplifying the code.
>>>
>>> Signed-off-by: René Scharfe <l.s.r@web.de>
>>> ---
>>
>> Makes sense.  Between the location of the original strbuf_addf()
>> call and the new strvec_pushf() call, nobody mucks with *opts so
>> this change won't affect the correctness.  We no longer use the
>> extra strbuf, and upon failing to open the rebased-patches file,
>> we no longer leak the contents of it.  Good.
>
> Ha!  I didn't even notice that leak on error.  Perhaps the two release
> calls at the end gave me the illusion of cleanliness?  Or more likely
> the opportunity to use strvec_pushf() grabbed my full attention (tunnel
> vision).

Perhaps I'll amend the end of the log message, like so, before
merging it down to 'next', then.

    ..., simplifying the code and plugging a small leak on the error
    codepath.

Thanks.

      reply	other threads:[~2023-12-20 15:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-19  7:42 [PATCH] rebase: use strvec_pushf() for format-patch revisions René Scharfe
2023-12-19 11:07 ` Phillip Wood
2023-12-19 12:25 ` Patrick Steinhardt
2023-12-19 17:12 ` Junio C Hamano
2023-12-20  8:04   ` René Scharfe
2023-12-20 15:57     ` Junio C Hamano [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=xmqqmsu4uasm.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=l.s.r@web.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).