Re: [PATCH 08/15] merge: handle NULL value for branch.<name>.mergeOptions
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 10, 2026, 16:53 UTC
- Message-ID
- <xmqqcxsctyow.fsf@gitster.g>
- In-Reply-To
- <12def237-2d01-404f-b7aa-b4f19e033cdc@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 19 quoted lines
> Hi Thomas
>
> On 07/11/2026 08:42, Thomas Bachem via GitGitGadget wrote:
>> diff --git a/builtin/merge.c b/builtin/merge.c
>> index 5b4eb23a83..fbabda97f8 100644
>> --- a/builtin/merge.c
>> +++ b/builtin/merge.c
>> @@ -668,6 +668,8 @@ static int git_merge_config(const char *k, const char *v,
>> skip_prefix(k, "branch.", &str) &&
>> skip_prefix(str, branch, &str) &&
>> !strcmp(str, ".mergeoptions")) {
>> + if (!v)
>> + return config_error_nonbool(k);
>> free(branch_mergeoptions);
>> branch_mergeoptions = xstrdup(v);
>> return 0;
>
> We treat an empty value differently to a missing value, I'm not sure if
> that makes sense or not.Sorry but I do not understand this comment.
[branch "main"] mergeOptions =
is an explicit "there is no extra options when we make a merge".
[branch "main"] mergeOptions
is an attempt to set a configuration variable to boolean "true". I am not sure if it helps users to pretend as if the latter were
[branch "main"] mergeOptions =
if that is what you are hinting. It would confuse them when they see a true boolean variable
[branch "main"] rebase
and wonder why
[branch "main"] rebase =
does not behave the same way, no?