From: Junio C Hamano <gitster@pobox.com>
To: Dominik Maier <dmnk@google.com>
Cc: git@vger.kernel.org, Patrick Steinhardt <ps@pks.im>,
Jeff King <peff@peff.net>, Taylor Blau <me@ttaylorr.com>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
dmnk+artist@google.com
Subject: Re: [PATCH] config: skip continued lines when matching section
Date: Thu, 19 Nov 2026 16:44:52 -0800 [thread overview]
Message-ID: <xmqqbj7ktjp7.fsf@gitster.g> (raw)
In-Reply-To: <20261119192307.2683812-1-dmnk@google.com> (Dominik Maier's message of "Thu, 19 Nov 2026 20:23:07 +0100")
Dominik Maier <dmnk@google.com> writes:
> When a value in the target section spans multiple lines via a trailing
> backslash and a continuation line begins with '[other]', removing or
> renaming the section stops early at '[other]' and leaves the remainder
> of the continued value behind as an unquoted '[other]' section.
If the behaviour was to treat these as continued values from day
one, I would have agreed that it would be a reasonably design, but
offhand I do not know if this is a breaking change in behaviour that
may negatively affect existing configuration files.
> @@ -3434,7 +3525,7 @@ static int repo_config_copy_or_rename_section_in_file(
> const char *old_name,
> const char *new_name, int copy)
> {
> - int ret = 0, remove = 0;
> + int ret = 0, remove = 0, continued = 0, in_quote = 0;
> char *filename_buf = NULL;
> struct lock_file lock = LOCK_INIT;
> int out_fd;
> @@ -3496,9 +3587,12 @@ static int repo_config_copy_or_rename_section_in_file(
> goto out;
> }
>
> + int was_continued = continued;
> +
This triggers -Wdeclaration-after-statement doesn't it?
(administrivia)
I do not consider myself an area expert for the configuration file
editing code. Please do not directly Cc: random people unless you
know they are specifically familiar with the area or they are
positively interested in the topic and they will regret if they miss
your message if they fail to notice.
Thanks.
next prev parent reply other threads:[~2026-11-20 0:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 19:23 [PATCH] config: skip continued lines when matching section Dominik Maier
2026-11-20 0:44 ` Junio C Hamano [this message]
2026-11-20 14:33 ` Phillip Wood
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=xmqqbj7ktjp7.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=dmnk+artist@google.com \
--cc=dmnk@google.com \
--cc=git@vger.kernel.org \
--cc=me@ttaylorr.com \
--cc=peff@peff.net \
--cc=ps@pks.im \
/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