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

Re: [PATCH 0/8] Doc/submodules: a few updates

From
Stefan Beller <sbeller@google.com>
Date
Jan 9, 2018, 18:50 UTC
Message-ID
<CAGZ79kZ97-sLS4mP28rLoMqf2z8KU0FZ5=fcogynYQKdxji=ng@mail.gmail.com>
In-Reply-To
<64503247-66ad-03cf-26ba-3383337971b5@gmail.com>

On Tue, Jan 9, 2018 at 9:06 AM, Kaartic Sivaraam <kaartic.sivaraam@gmail.com> wrote:

Show 28 quoted lines
> On Tuesday 09 January 2018 12:38 AM, Stefan Beller wrote:
>> On Sat, Jan 6, 2018 at 10:46 AM, Kaartic Sivaraam
>> <kaartic.sivaraam@gmail.com> wrote:
>>
>> While small patches are really appreciated for code (bisect, automated
>> testing, and
>> the general difficulty to reason about code, as a very small change
>> may affect the whole
>> code base), I am not sure if they benefit in documentation.
>> Documentation is a rather
>> local human readable thing, so by changing one sentence we don't
>> affect the understanding
>> of documentation at a completely unrelated place.
>>
>> Also it helps to read more than just sentence fragments, i.e. I tried
>> looking at the
>> whole paragraph for review. May I suggest to squash them all and
>> resend as one patch?
>>
>
> I wouldn't mind that. I thought it might be easy to find to find the
> parts I changed when the patches are small. So, I sent them without
> squashing them together. In case you feel it's not worth, let me know so
> I'll squash them in.
>
> BTW, in case I did squash them in, would it be nice to keep the commit
> subjects of the current patch series as bullet points in the unified
> commit message?
Sure.
Show 16 quoted lines
>> I wonder if this indicates a lack of documentation when the active
>> flags were introduced.
>> They are found in 'man git config', but maybe we need to spell them
>> out explicitly
>> in the submodule related docs.
>>
>
> Possibly. So, why not in Documentation/gitsubmodules! Here's a replaced
> version of that paragraph,
>
>     * The configuration file `$GIT_DIR/config` in the superproject.
>    Typically this file is used to specify whether the submodule
>    is recursed into at all via the `active` flag for example. A
>    submodule is considered active if `submodule.<name>.url` is set
>    or if the submodules path is present in `submodule.active` or
>    if `submodule.<name>.url` is set.

I wonder if we'd want to give an example later, and first describe the mechanics precisely:

   The configuration file `$GIT_DIR/config` in the superproject.
    Git only recurses into active submodules. A submodule is
    considered active (a) if `submodule.<name>.active` is set
    or (b) if the submodules path is matches the pathsepc in
    `submodule.active` or (c) if `submodule.<name>.url` is set.
    (c) is a historical artefact and will be ignored if the pathspec
    set in (b) excludes the submodule. For example:
    [submodule "foo"]
        active = false
        url = https://example.org/foo
    [submodule "bar"]
        active = true
        url = https://example.org/bar
    [submodule "baz"]
        url = https://example.org/baz
    In the above config only the submodule bar and baz are active,
    bar due to (a) and baz due to (c). Another example
    [submodule "foo"]
        active = true
        url = https://example.org/foo
    [submodule "bar"]
        url = https://example.org/bar
    [submodule "baz"]
        url = https://example.org/baz
    [submodule "bob"]
        ignore = true
    [submodule]
        active = b*
        active = (:exclude) baz
    In here all submodules except baz (foo, bar, bob) are active.
    'foo' due to its own active flag and all the others due to the
    submodule active pathspec, which specifies that any submodule
    starting with 'b' except 'baz' are also active, no matter if the .url field
    is present.
Show 29 quoted lines
>>> 2.
>>>
>>>  man git submodule
>>>
>>>        update
>>>            ...
>>>
>>>            checkout
>>>                ....
>>>
>>>                If --force is specified, the submodule will be checked out (using git checkout --force if appropriate), even if the commit
>>>                specified in the index of the containing repository already matches the commit checked out in the submodule.
>>>
>>> I'm not sure this is conveying all the information it should be conveying.
>>> It seems to making the user wonder, "How at all does 'git submodule update --force'
>>> differs from 'git submodule update'?" also "using git checkout --force if appropriate"
>>> seems to be invoking all sorts confusion as "appropriate" is superfluous.
>>
>> When "submodule update" is invoked with the `--force` flag, that flag is passed
>> on to the 'checkout' operation. If you do not give the --force, then
>> the checkout
>> will also be done without --force.
>>
>
> If that's the case then shouldn't the "if appropriate" part of "(using
> git checkout --force if appropriate)" be dropped? That seems to make it
> clear, at least for me. Or is intended as '--force' will not be passed
> to git checkout all the time?
>

Yes, essentially we only pass the force flag when we were given the force flag ("when appropriate" :) Not sure how to say that otherwise. But dropping sounds good)

Stefan
Previous: Kaartic SivaraamNext: Kaartic Sivaraam
Message 34 of 44 in “Doc/submodules: a few updates”
  1. 0/8 Doc/submodules: a few updatesKaartic Sivaraam, Jan 6, 2018
  2. 1/8 Doc/gitsubmodules: split a sentence for better readabilityKaartic Sivaraam, Jan 6, 2018
  3. Eric SunshineJan 7, 2018
  4. Stefan BellerJan 8, 2018
  5. 2/8 Doc/gitsubmodules: clearly specify advantage of submoduleKaartic Sivaraam, Jan 6, 2018
  6. Stefan BellerJan 8, 2018
  7. Kaartic SivaraamJan 9, 2018
  8. 3/8 Doc/gitsubmodules: specify how submodules help in reduced sizeKaartic Sivaraam, Jan 6, 2018
  9. Eric SunshineJan 7, 2018
  10. Stefan BellerJan 8, 2018
  11. Kaartic SivaraamJan 9, 2018
  12. Stefan BellerJan 9, 2018
  13. Kaartic SivaraamJan 9, 2018
  14. 4/8 Doc/gitsubmodules: avoid abbreviationsKaartic Sivaraam, Jan 6, 2018
  15. Eric SunshineJan 7, 2018
  16. Stefan BellerJan 8, 2018
  17. Kaartic SivaraamJan 9, 2018
  18. Stefan BellerJan 9, 2018
  19. Kaartic SivaraamJan 9, 2018
  20. 5/8 Doc/gitsubmodules: use "Git directory" consistentlyKaartic Sivaraam, Jan 6, 2018
  21. Eric SunshineJan 7, 2018
  22. Stefan BellerJan 8, 2018
  23. 6/8 Doc/gitsubmodules: improve readability of certain linesKaartic Sivaraam, Jan 6, 2018
  24. Eric SunshineJan 7, 2018
  25. Stefan BellerJan 8, 2018
  26. Kaartic SivaraamJan 9, 2018
  27. Stefan BellerJan 9, 2018
  28. Kaartic SivaraamJan 9, 2018
  29. 7/8 Doc/git-submodule: improve readability and grammar of a sentenceKaartic Sivaraam, Jan 6, 2018
  30. Stefan BellerJan 8, 2018
  31. 8/8 Doc/git-submodule: correctly quote important wordsKaartic Sivaraam, Jan 6, 2018
  32. Stefan BellerJan 8, 2018
  33. Kaartic SivaraamJan 9, 2018
  34. Stefan BellerJan 9, 2018
  35. 0/2 Doc/submodules: a few updatesKaartic Sivaraam, Jan 10, 2018
  36. 1/2 Doc/gitsubmodules: make some changes to improve readability and syntaxKaartic Sivaraam, Jan 10, 2018
  37. Stefan BellerJan 10, 2018
  38. 2/2 Doc/git-submodule: improve readability and grammar of a sentenceKaartic Sivaraam, Jan 10, 2018
  39. 0/2 Doc/submodules: a few updatesKaartic Sivaraam, Jan 14, 2018
  40. 1/2 Doc/gitsubmodules: make some changes to improve readability and syntaxKaartic Sivaraam, Jan 14, 2018
  41. Stefan BellerJan 16, 2018
  42. 2/2 Doc/git-submodule: improve readability and grammar of a sentenceKaartic Sivaraam, Jan 14, 2018
  43. Junio C HamanoJan 16, 2018
  44. Kaartic SivaraamJan 17, 2018

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.