From: Junio C Hamano <gitster@pobox•com>
To: Jeff King <peff@peff•net>
Cc: Kristoffer Haugsbakk <code@khaugsbakk•name>,
Phillip Wood <phillip.wood@dunelm•org.uk>,
git@vger•kernel.org
Subject: Re: [BUG] rebase: can write reflog with uninit. `action` string
Date: Thu, 01 May 2025 10:53:22 -0700 [thread overview]
Message-ID: <xmqqcycsxlnx.fsf@gitster.g> (raw)
In-Reply-To: <20250501163822.GE1795346@coredump.intra.peff.net> (Jeff King's message of "Thu, 1 May 2025 12:38:22 -0400")
Jeff King <peff@peff•net> writes:
> On Thu, May 01, 2025 at 09:07:06AM -0700, Junio C Hamano wrote:
>
>> > va_start(ap, fmt);
>> > - strbuf_reset(&buf);
>> > + strbuf_release(&buf); /* guarantees realloaction */
>>
>> I initially thought that this comment may have to be updated in the
>> production version, but because we have to freshly allocate for each
>> new message for ownership change, this comment still is correct.
>> The only difference between the "here is how to expose" and "this is
>> part of the smallest solution" is why we want to guarantee it.
>
> This code change is just to stimulate the bug more readily. ;)
>
> I think if we started to actually allocate here, we'd want to switch the
> "return buf.buf" at the end to strbuf_detach().
That's sensible.
next prev parent reply other threads:[~2025-05-01 17:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-28 19:40 [BUG] rebase: can write reflog with uninit. `action` string Kristoffer Haugsbakk
2025-04-29 9:22 ` Phillip Wood
2025-04-29 19:40 ` Kristoffer Haugsbakk
2025-04-29 21:51 ` Jeff King
2025-04-30 15:17 ` Kristoffer Haugsbakk
2025-05-01 13:17 ` Jeff King
2025-05-01 14:36 ` phillip.wood123
2025-05-01 15:36 ` Jeff King
2025-05-01 16:07 ` Junio C Hamano
2025-05-01 16:38 ` Jeff King
2025-05-01 17:53 ` Junio C Hamano [this message]
2025-05-01 14:10 ` phillip.wood123
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=xmqqcycsxlnx.fsf@gitster.g \
--to=gitster@pobox$(echo .)com \
--cc=code@khaugsbakk$(echo .)name \
--cc=git@vger$(echo .)kernel.org \
--cc=peff@peff$(echo .)net \
--cc=phillip.wood@dunelm$(echo .)org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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