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

Re: [PATCH] pull: respect submodule update configuration

From
BWBrandon Williams <bmwill@google.com>
Date
Aug 21, 2017, 18:21 UTC
Message-ID
<20170821182110.GA156514@google.com>
In-Reply-To
<CAGZ79kZMjGNOn0FnJGtO5gRY3rF0Eiow8n0uppTZsCUAHY+m3A@mail.gmail.com>
On 08/21, Stefan Beller wrote:
Show 45 quoted lines
> On Mon, Aug 21, 2017 at 10:20 AM, Lars Schneider
> <larsxschneider@gmail.com> wrote:
> >
> >> On 21 Aug 2017, at 18:55, Stefan Beller <sbeller@google.com> wrote:
> >>
> >> On Mon, Aug 21, 2017 at 9:20 AM, Heiko Voigt <hvoigt@hvoigt.net> wrote:
> >>
> >>>> So I am a bit curious to learn which part of this change you dislike
> >>>> and why.
> >>>
> >>> I am also curious. Isn't this the same strategy we are using in other
> >>> places?
> >>>
> >>
> >> I dislike it because the UX feels crude.  When reading the documentation,
> >> it seems to me as if submodule.<name> can be one of the following
> >>
> >>    (none, checkout, rebase, merge, !<custom-command>)
> >>
> >> This is perfect for "submodule-update", whose primary goal is
> >> to update submodules *somehow*. However other commands
> >>
> >>    git rebase --recurse
> >>    git merge --recurse
> >>    git checkout --recurse
> >>
> >> have a different primary mode of operation (note how their name
> >> is one of the modes from the set above), so it may get confusing
> >> for a user.
> >>
> >> 'none'  and '!<custom-command>' seem like they would be okay
> >> for any of the commands above but then:
> >>
> >>    git config submodule.<name>.update "!..."
> >>    git reset --hard --recurse
> >>    git status
> >>    # submodule is reported, because "!..." did not 'reset'.
> >>
> >> Anyway. That dislike is just a minor gut feeling about the UX/UI
> >> being horrible. I wrote the patch to keep the conversation going,
> >> and if it fixes Lars problem, let's take it for now.
> >
> > Well, I need just a way to disable certain Submodules completely.
> > If you show me how "git config --local submodule.sub.active false"
> > works then I don't need this patch.

Yeah if you want to completely disable a submodule (as in not even check it out) then setting .active to false would do that. But as stefan pointed out and IIRC 'submodule update --init' with no pathspec sets all submodules to be active. Perhaps it should only init submodules who don't already have an explicit active flag set.

Show 21 quoted lines
> >
> > I tried to make it work here:
> > https://public-inbox.org/git/89AB8AA3-8E19-46BA-B169-D1EA4CF4ABE7@gmail.com/
> 
> (A) you need to set expect there as well, to have sub{2,4,5} be expected
> there as well.
> 
> (B) That may hint at another (UX) bug.
> 
> The test case there uses "git submodule update --init".
> The init flag will set all submodules to active.
> 
> Maybe you want
> 
>     git config submodule.active ":(exclude)sub0"
>     git config --add submodule.active ":(exclude)sub2"
>     git config --add submodule.active "."
>     # Read: anything except sub0 and sub2 are interesting
> 
>     git submodule update
>     # no init flag, needed even for new submodules IIUC
-- 
Brandon Williams
Previous: Stefan BellerNext: Junio C Hamano
Message 33 of 38 in “Submodule regression in 2.14?”
  1. Lars SchneiderAug 16, 2017
  2. Stefan BellerAug 16, 2017
  3. Stefan BellerAug 16, 2017
  4. Lars SchneiderAug 17, 2017
  5. Stefan BellerAug 17, 2017
  6. Junio C HamanoAug 18, 2017
  7. Stefan BellerAug 18, 2017
  8. Junio C HamanoAug 18, 2017
  9. Stefan BellerAug 18, 2017
  10. Junio C HamanoAug 19, 2017
  11. Heiko VoigtAug 21, 2017
  12. Stefan BellerAug 21, 2017
  13. Heiko VoigtAug 22, 2017
  14. Stefan BellerAug 22, 2017
  15. Heiko VoigtAug 25, 2017
  16. Stefan BellerAug 25, 2017
  17. Junio C HamanoAug 25, 2017
  18. Junio C HamanoAug 21, 2017
  19. Heiko VoigtAug 22, 2017
  20. Stefan BellerAug 21, 2017
  21. Junio C HamanoAug 21, 2017
  22. Lars SchneiderAug 18, 2017
  23. Stefan BellerAug 18, 2017
  24. Junio C HamanoAug 18, 2017
  25. pull: respect submodule update configurationStefan Beller, Aug 18, 2017
  26. Stefan BellerAug 18, 2017
  27. Junio C HamanoAug 19, 2017
  28. Junio C HamanoAug 19, 2017
  29. Heiko VoigtAug 21, 2017
  30. Stefan BellerAug 21, 2017
  31. Lars SchneiderAug 21, 2017
  32. Stefan BellerAug 21, 2017
  33. Brandon WilliamsAug 21, 2017
  34. Junio C HamanoAug 21, 2017
  35. Lars SchneiderAug 22, 2017
  36. Stefan BellerAug 22, 2017
  37. Brandon WilliamsAug 22, 2017
  38. Lars SchneiderAug 19, 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.