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

Re: [bug] generic issue with git_config handlers

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 5, 2008, 00:03 UTC
Message-ID
<7vk5lki815.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<200802050013.20335.chriscool@tuxfamily.org>
Christian Couder <chriscool@tuxfamily.org> writes:
Show 5 quoted lines
> Very unfortunate.
>
> I finally had the following patch that passed all tests (it changed only one 
> test), in case someone wants to suggest that we change git_config_bool, 
> hint, hint!

Sorry, I do not get what you are hinting at. The fact that you passed all the tests suggests that we have a gap in the test coverage for these two, so you are inviting more tests from others?

Show 14 quoted lines
> diff --git a/config.c b/config.c
> index 526a3f4..a2c7214 100644
> --- a/config.c
> +++ b/config.c
> @@ -131,7 +131,7 @@ static int get_value(config_fn_t fn, char *name, 
> unsigned in
>         while (c == ' ' || c == '\t')
>                 c = get_next_char();
>
> -       value = NULL;
> +       value = "";
>         if (c != '\n') {
>                 if (c != '=')
>                         return -1;

As long as you have this, I do not think you can avoid breaking existing repositories that have:

        [core]
                autocrlf
		filemode =

and expect git to say "Ah, core.autocrlf is set to true, and filemode is not trustable, so I need to do a MS-DOG".

	$ git config --bool core.autocrlf
        true
        $ git config --bool core.filemode
        false

Your "builtin-config.c" patch looks better than before (which would segfault), but I think

	$ git config --bool --list

could pay attention to the "type" thing set earlier, just like show_config() does.

Previous: Christian CouderNext: Christian Couder
Message 7 of 8 in “[bug] generic issue with git_config handlers”
  1. Pierre HabouzitJan 31, 2008
  2. Junio C HamanoJan 31, 2008
  3. Pierre HabouzitJan 31, 2008
  4. Christian CouderFeb 4, 2008
  5. Johannes SixtFeb 4, 2008
  6. Christian CouderFeb 4, 2008
  7. Junio C HamanoFeb 5, 2008
  8. Christian CouderFeb 7, 2008

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.