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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 29, 2025, 22:41 UTC
Message-ID
<xmqqh5yuoc14.fsf@gitster.g>
In-Reply-To
<CAE7as+ZUcqRbnOC11DQ7=b+YB+9HTfjfqCvxzmz+mpSH6DxkGQ@mail.gmail.com>
Ayush Chandekar <ayu.chandekar@gmail.com> writes:
Show 10 quoted lines
>> 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.

Previous: Ayush ChandekarNext: Ayush Chandekar
Message 12 of 19 in “builtin/fmt-merge-msg: remove dependency on global variables and 'the_repository'”
  1. 0/2 builtin/fmt-merge-msg: remove dependency on global variables and 'the_repository'Ayush Chandekar, Jul 29, 2025
  2. 1/2 environment: remove the global variable 'merge_log_config'Ayush Chandekar, Jul 29, 2025
  3. Junio C HamanoJul 29, 2025
  4. Ayush ChandekarJul 29, 2025
  5. Junio C HamanoJul 29, 2025
  6. Phillip WoodJul 29, 2025
  7. Ayush ChandekarJul 29, 2025
  8. Phillip WoodJul 30, 2025
  9. 2/2 builtin/fmt-merge-msg: stop depending on 'the_repository'Ayush Chandekar, Jul 29, 2025
  10. Junio C HamanoJul 29, 2025
  11. Ayush ChandekarJul 29, 2025
  12. Junio C HamanoJul 29, 2025
  13. Ayush ChandekarAug 10, 2025
  14. 0/2 builtin/fmt-merge-msg: remove dependency on global variables and 'the_repository'Ayush Chandekar, Aug 10, 2025
  15. 1/2 environment: remove the global variable 'merge_log_config'Ayush Chandekar, Aug 10, 2025
  16. Phillip WoodAug 11, 2025
  17. Junio C HamanoAug 11, 2025
  18. Ayush ChandekarAug 11, 2025
  19. 2/2 builtin/fmt-merge-msg: stop depending on 'the_repository'Ayush Chandekar, Aug 10, 2025

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.