git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] config: skip continued lines when matching section

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 20, 2026, 00:44 UTC
Message-ID
<xmqqbj7ktjp7.fsf@gitster.g>
In-Reply-To
<20261119192307.2683812-1-dmnk@google.com>
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.

Show 15 quoted lines
> @@ -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.
Previous: Dominik Maier
Message 2 of 2 in “config: skip continued lines when matching section”
  1. config: skip continued lines when matching sectionDominik Maier, Nov 19, 2026
  2. Junio C HamanoNov 20, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.