On Tue, Jul 29, 2025 at 10:11 PM Junio C Hamano <gitster@xxxxxxxxx> wrote: > > Ayush Chandekar <ayu.chandekar@xxxxxxxxx> writes: > > > Refactor builtin/fmt-merge-msg.c to remove the dependancy on the global > > 'the_repository'. Replace all the occurrences of 'the_repository' with > > 'repo', where 'repo' is a pointer to 'struct repository' passed to the > > function 'cmd_fmt_merge_msg()' and thus remove the definition '#define > > USE_THE_REPOSITORY_VARIABLE'. Also, add a test to make sure that "git > > fmt-merge-msg -h" can be called outside a repository. > > This also moves the call to git_config()/repo_config() after > parse_options(). > > 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. > In any case, the reason for this change of the order between config > and parse-options is not explained at all in the proposed log > message. > Apologies, I will mention it.