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

Re: [PATCHv9 1/6] submodule-config: keep update strategy around

From
Stefan Beller <sbeller@google.com>
Date
Feb 9, 2016, 22:19 UTC
Message-ID
<CAGZ79kYm79C7tLECeJCrS3JoCudUT-8geovoMpT8qoHpYBjUAg@mail.gmail.com>
In-Reply-To
<xmqqh9hh382i.fsf@gitster.mtv.corp.google.com>
On Tue, Feb 9, 2016 at 1:08 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 7 quoted lines
>> +     } else if (!strcmp(item.buf, "update")) {
>> +             if (!value)
>> +                     ret = config_error_nonbool(var);
>> +             else if (!me->overwrite &&
>> +                 submodule->update != SM_UPDATE_UNSPECIFIED)
>
> Funny indentation here (locally fixable).

I looked through the code base and reread our CodingGuidelines to find out what is considered correct. (I assumed we had a gnu-ish coding style w.r.t. breaking overly long lines in conditions, which is having the next line be indented with 4 spaces.)

So I assume by funny you mean "the next line doesn't start below the opening parenthesis"?

That would seem to be consistent as it fits both the 4 space indentation
which is always found below "if (", but we have more than 4 spaces in
other places such as overly long return statements, i.e. refs.c, l 610
(@origin/master)
        return starts_with(refname, "refs/heads/") ||
                starts_with(refname, "refs/remotes/") ||
                starts_with(refname, "refs/notes/") ||
                !strcmp(refname, "HEAD");
which also doesn't seem to align perfectly to me.

Looking for places, which have the pattern "else if (..." with line break, I found several different styles.

builtin/mv.c (@origin/master) has two occurrences of
    else if (...
    <2 additional tabs> condition continues here
and another of
    else if (...
    <1 tab + 1 SP> condition nearly aligned to statement below

Looking at remote.c, I can find 1 tab, plus 3 spaces. ... Giving up to come up with an idea for space based rule other than "visually align it below the original statement".

Puzzled, Stefan

Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 30 in “[PATCHv9 0/6] Expose submodule parallelism to the user”
  1. Stefan BellerFeb 9, 2016
  2. 1/6 submodule-config: keep update strategy aroundStefan Beller, Feb 9, 2016
  3. Junio C HamanoFeb 9, 2016
  4. Stefan BellerFeb 9, 2016
  5. Junio C HamanoFeb 9, 2016
  6. Jonathan NiederFeb 9, 2016
  7. Junio C HamanoFeb 9, 2016
  8. Junio C HamanoFeb 11, 2016
  9. 2/6 submodule-config: drop check against NULLStefan Beller, Feb 9, 2016
  10. Jonathan NiederFeb 9, 2016
  11. 3/6 fetching submodules: respect `submodule.fetchJobs` config optionStefan Beller, Feb 9, 2016
  12. Junio C HamanoFeb 9, 2016
  13. Jonathan NiederFeb 9, 2016
  14. Stefan BellerFeb 10, 2016
  15. Junio C HamanoFeb 10, 2016
  16. Junio C HamanoFeb 10, 2016
  17. 4/6 git submodule update: have a dedicated helper for cloningStefan Beller, Feb 9, 2016
  18. Junio C HamanoFeb 9, 2016
  19. Jonathan NiederFeb 10, 2016
  20. Jacob KellerFeb 10, 2016
  21. Stefan BellerFeb 10, 2016
  22. Jacob KellerFeb 11, 2016
  23. 5/6 submodule update: expose parallelism to the userStefan Beller, Feb 9, 2016
  24. 6/6 clone: allow an explicit argument for parallel submodule clonesStefan Beller, Feb 9, 2016
  25. Junio C HamanoFeb 9, 2016
  26. Stefan BellerFeb 9, 2016
  27. Junio C HamanoFeb 9, 2016
  28. Junio C HamanoFeb 11, 2016
  29. Junio C HamanoFeb 11, 2016
  30. Stefan BellerFeb 11, 2016

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.