Subject: Re: [PATCH] config.c: change the function signature of `git_config_string()`

From: Junio C Hamano <[email-masked]>
Date: Wed, 23 Jul 2014 10:25:51 -0700

Matthieu Moy <[email-masked]> writes:

> Junio C Hamano <[email-masked]> writes:
>
>> *1* We have safe_create_leading_directories_const() that works
>> around this for input parameter around its _const less counterpart,
>> which is ugly but livable solution.
>
> I think it would actually be a reasonable solution to avoid casting here
> and there on the caller side.

"Ugly" primarily refers to the fact that we are forced to do this in
the first place by the language.  I agree with you, especially if we
have very many call sites, and I suspect config-get-string actually
would.

> Another option would be to _return_ a non-const char * instead of
> outputing it as a by-address parameter.

Here, too, I agree that it is the most C-ish interface.