Subject: Re: [PATCH v2 0/3] breaking-changes: deprecate support for core.commentChar=auto

From: Phillip Wood <[email-masked]>
Date: Fri, 1 Aug 2025 11:36:57 +0100

On 01/08/2025 04:50, Junio C Hamano wrote:
> Phillip Wood <[email-masked]> writes:
> 
>> Changes since V1:
>>   - Rebased onto a merge of 'ps/config-wo-the-repository' and 'master'
> 
> OK.  I needed the following merge-fix to make this merge work.
> 
> diff --git w/environment.c c/environment.c
> index ae1427bb9e..a0ac5934b3 100644
> --- w/environment.c
> +++ c/environment.c
> @@ -461,9 +461,11 @@ static int git_default_core_config(const char *var, const char *value,
>   	    !strcmp(var, "core.commentstring")) {
>   		if (!value)
>   			return config_error_nonbool(var);
> -		else if (!strcasecmp(value, "auto"))
> +		else if (!strcasecmp(value, "auto")) {
>   			auto_comment_line_char = 1;
> -		else if (value[0]) {
> +			FREE_AND_NULL(comment_line_str_to_free);
> +			comment_line_str = "#";
> +		} else if (value[0]) {
>   			if (strchr(value, '\n'))
>   				return error(_("%s cannot contain newline"), var);
>   			comment_line_str = value;
> 
> I guess I used to carry an equivalent as a recurrent merge-fix for
> your topic branch, but rolling it into the base of the series is
> certainly safer (i.e. we have to do a merge and resolve conflicts
> just once, and after that we won't even touch it---as opposed to
> keep recreating the same conflict and resolving every time we merge
> your topic via rerere & merge-fix mechanism).

I was hoping that rebasing on master would eliminate the need for a fix 
as 'ac/auto-comment-char-fix' is now in master but in the meantime 
'ps/config-wo-the-repository' came along and moved code from config.c to 
environment.c without those changes. I'd assumed you already had a 
similar fixup when merging 'ps/config-wo-the-repository' into seen.

Thanks

Phillip