From: Junio C Hamano <gitster@pobox.com>
To: Taylor Blau <me@ttaylorr.com>
Cc: Han Jiang <jhcarl0814@gmail.com>,
git@vger.kernel.org, Patrick Steinhardt <ps@pks.im>,
Derrick Stolee <stolee@gmail.com>
Subject: Re: git config set --file, key-value pair without '= value', gives Segmentation fault
Date: Wed, 31 Jul 2024 18:28:45 -0700 [thread overview]
Message-ID: <xmqq1q39yqsy.fsf@gitster.g> (raw)
In-Reply-To: <ZqrKeG+alFldB7OY@nand.local> (Taylor Blau's message of "Wed, 31 Jul 2024 19:36:34 -0400")
Taylor Blau <me@ttaylorr.com> writes:
> I tried to match the behavior a few lines down in that function, where
> we only call regexec() if value is non-NULL.
Yes, that is exactly what made me question the code. With the
current code, valueless true cannot be updated with "--value"
restriction, ever, because it will never match anything.
In any case, the patch is a strict improvement over the current code
that segfaults. Making it aware of "--type=bool" and have it treat
synonymous values of true/false properly would be better left as a
follow-up topic.
Thanks.
prev parent reply other threads:[~2024-08-01 1:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-31 11:55 git config set --file, key-value pair without '= value', gives Segmentation fault Han Jiang
2024-07-31 21:36 ` Taylor Blau
2024-07-31 22:47 ` Junio C Hamano
2024-07-31 23:36 ` Taylor Blau
2024-07-31 23:46 ` Han Jiang
2024-08-01 1:28 ` 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=xmqq1q39yqsy.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jhcarl0814@gmail.com \
--cc=me@ttaylorr.com \
--cc=ps@pks.im \
--cc=stolee@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox