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

Re: [PATCH/RFC v2 1/2] git_default_config() rewritten using the config-set API

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 13, 2014, 17:18 UTC
Message-ID
<xmqq4mxg48b3.fsf@gitster.dls.corp.google.com>
In-Reply-To
<vpq1tsks7kg.fsf@anie.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
Show 24 quoted lines
> Tanay Abhra <tanayabh@gmail.com> writes:
>
>> git_default_config() now uses config-set API functions to query for
>> values.
>
> I believe you missed a few spots:
>
> $ git grep -n 'git_default_config[^(]'
> Documentation/user-manual.txt:4287:        git_config(git_default_config);
> archive.c:416:  git_config(git_default_config, NULL);
> builtin/config.c:577:           git_config(git_default_config, NULL);
> color.h:73: * if you are just going to change to git_default_config, too.
> fetch-pack.c:880:       git_config(git_default_config, NULL);
> http.c:393:     config.cascade_fn = git_default_config;
> rerere.c:580:   git_config(git_default_config, NULL);
> rerere.c:710:   git_config(git_default_config, NULL);
>
> The following ones should probably be rewritten too:
>
> archive.c:416:  git_config(git_default_config, NULL);
> builtin/config.c:577:           git_config(git_default_config, NULL);
> fetch-pack.c:880:       git_config(git_default_config, NULL);
> rerere.c:580:   git_config(git_default_config, NULL);
> rerere.c:710:   git_config(git_default_config, NULL);

For a one-person toy project it is OK to repurpose the existing git_default_config() to do completely different thing and make it a flag day to switch the entire codebase, but in a collaborative environment where there may be multiple topics in flight, some of which may be happening where you are not even aware of, it is better to remove the existing git_default_config() and use a different name for the different function you are introducing, to force new places that expect the old git_default_config() to work as before to be noticed with a linkage error.

Previous: Matthieu MoyNext: Matthieu Moy
Message 17 of 19 in “fast-import.c: replace `git_config()` with `git_config_get_*()` family”
  1. 1/4 fast-import.c: replace `git_config()` with `git_config_get_*()` familyTanay Abhra, Aug 13, 2014
  2. 2/4 ll-merge.c: refactor `read_merge_config()` to use `git_config_string()`Tanay Abhra, Aug 13, 2014
  3. Matthieu MoyAug 13, 2014
  4. 2/4 ll-merge.c: refactor `read_merge_config()` to use `git_config_string()`Tanay Abhra, Aug 13, 2014
  5. Matthieu MoyAug 13, 2014
  6. Junio C HamanoAug 13, 2014
  7. 3/4 merge-recursive.c: replace `git_config()` with `git_config_get_int()`Tanay Abhra, Aug 13, 2014
  8. Matthieu MoyAug 13, 2014
  9. 4/4 builtin/apply.c: replace `git_config()` with `git_config_get_string_const()`Tanay Abhra, Aug 13, 2014
  10. Matthieu MoyAug 13, 2014
  11. Tanay AbhraAug 13, 2014
  12. 1/5 fast-import.c: replace `git_config()` with `git_config_get_*()` familyTanay Abhra, Aug 13, 2014
  13. Matthieu MoyAug 13, 2014
  14. 1/2 git_default_config() rewritten using the config-set APITanay Abhra, Aug 13, 2014
  15. 2/2 use the new git_default_config()Tanay Abhra, Aug 13, 2014
  16. Matthieu MoyAug 13, 2014
  17. Junio C HamanoAug 13, 2014
  18. Matthieu MoyAug 13, 2014
  19. Junio C HamanoAug 13, 2014

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.