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

Re: [BUG] submodule config does not apply to upper case submodules?

From
Stefan Beller <sbeller@google.com>
Date
Feb 15, 2017, 23:43 UTC
Message-ID
<CAGZ79kZgmtH1-1i5Fenq8kELbafBL1tCx66SGqGVBmjbpLoBGQ@mail.gmail.com>
In-Reply-To
<xmqqh93v10vy.fsf@gitster.mtv.corp.google.com>
On Wed, Feb 15, 2017 at 3:37 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 46 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>> Yes; though I'd place it in strbuf.{c,h} as it is operating
>> on the internals of the strbuf. (Do we make any promises outside of
>> strbuf about the internals? I mean we use .buf all the time, so maybe
>> I am overly cautious here)
>
> I'd rather have it not use struct strbuf as an interface.  It only
> needs to pass "char *" and its promise that it touches the string
> in-place without changing the length need to be documented as a
> comment before the function.
>
>>>  config.c | 16 +++++++++++++++-
>>>  1 file changed, 15 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/config.c b/config.c
>>> index c6b874a7bf..98bf8fee32 100644
>>> --- a/config.c
>>> +++ b/config.c
>>> @@ -201,6 +201,20 @@ void git_config_push_parameter(const char *text)
>>>         strbuf_release(&env);
>>>  }
>>>
>>> +static void canonicalize_config_variable_name(struct strbuf *var)
>>> +{
>>> +       char *first_dot = strchr(var->buf, '.');
>>> +       char *last_dot = strrchr(var->buf, '.');
>>
>> If first_dot != NULL, then last_dot !+ NULL as well.
>> (either both are NULL or none of them),
>> so we can loose one condition below.
>
> I do not think it is worth it, though.
>
>>> +       char *cp;
>>> +
>>> +       if (first_dot)
>>> +               for (cp = var->buf; *cp && cp < first_dot; cp++)
>>> +                       *cp = tolower(*cp);
>>> +       if (last_dot)
>>> +               for (cp = last_dot; *cp; cp++)
>>> +                       *cp = tolower(*cp);
>
>         if (first_dot) {
>                 scan up to first dot
>                 if (last_dot)
just leave out the 'if (last_dot)' ?
    if (first_dot)  {
        /* also implies last_dot */
        do 0 -> first
        do last -> end
    }
Previous: Junio C HamanoNext: Junio C Hamano
Message 12 of 41 in “[BUG] submodule config does not apply to upper case submodules?”
  1. Lars SchneiderFeb 15, 2017
  2. t7400: cleanup "submodule add clone shallow submodule" testLars Schneider, Feb 15, 2017
  3. Stefan BellerFeb 15, 2017
  4. Junio C HamanoFeb 15, 2017
  5. Stefan BellerFeb 15, 2017
  6. Junio C HamanoFeb 15, 2017
  7. Jonathan TanFeb 15, 2017
  8. Junio C HamanoFeb 15, 2017
  9. Junio C HamanoFeb 15, 2017
  10. Stefan BellerFeb 15, 2017
  11. Junio C HamanoFeb 15, 2017
  12. Stefan BellerFeb 15, 2017
  13. Junio C HamanoFeb 15, 2017
  14. Jeff KingFeb 16, 2017
  15. Jonathan TanFeb 15, 2017
  16. Junio C HamanoFeb 16, 2017
  17. config: preserve <subsection> case for one-shot config on the command lineJunio C Hamano, Feb 15, 2017
  18. Lars SchneiderFeb 16, 2017
  19. Junio C HamanoFeb 16, 2017
  20. Jeff KingFeb 16, 2017
  21. Junio C HamanoFeb 17, 2017
  22. Junio C HamanoFeb 20, 2017
  23. Lars SchneiderFeb 20, 2017
  24. Jeff KingFeb 21, 2017
  25. Junio C HamanoFeb 21, 2017
  26. config: preserve <subsection> case for one-shot config on the command lineJunio C Hamano, Feb 21, 2017
  27. Jeff KingFeb 21, 2017
  28. Stefan BellerFeb 21, 2017
  29. config: reject invalid VAR in 'git -c VAR=VAL command'Junio C Hamano, Feb 21, 2017
  30. Stefan BellerFeb 21, 2017
  31. Junio C HamanoFeb 21, 2017
  32. config: reject invalid VAR in 'git -c VAR=VAL command'Junio C Hamano, Feb 21, 2017
  33. Junio C HamanoFeb 22, 2017
  34. Jeff KingFeb 23, 2017
  35. Junio C HamanoFeb 23, 2017
  36. Junio C HamanoFeb 23, 2017
  37. Jeff KingFeb 24, 2017
  38. Junio C HamanoFeb 24, 2017
  39. Jeff KingFeb 24, 2017
  40. Junio C HamanoFeb 24, 2017
  41. Jeff KingFeb 24, 2017

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.