Subject: Re: [GSOC PATCH 2/2] builtin/fmt-merge-msg: stop depending on 'the_repository'

From: Junio C Hamano <[email-masked]>
Date: Tue, 29 Jul 2025 15:41:27 -0700

Ayush Chandekar <[email-masked]> writes:

>> It generally is a bad idea to read command line options first and
>> then read the configuration (it is a bug if such a flow causes
>> values from configuration to overwrite values from command line).
>> THe current set of options and configuration variables may not
>> overlap, in which case such a questionable arrangement happen to be
>> without bug right now, but it would prevent future developers from
>> adding new options and configuration variables and make them
>> interact with each other in the most natural way.
>
> I understand it, but how do we tackle if NULL repository is passed.

Perhaps you want to study the problem space and related past changes
before going forward.  The first place to look at is what happens
when you call repo_config(), outside a repository or a working tree
and repository is NULL.

f29f1990 (config: teach repo_config to allow `repo` to be NULL,
2025-03-08) and what it calls "the following commits" may be
illuminating.