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

Re: [PATCH] pull: respect submodule update configuration

From
Stefan Beller <sbeller@google.com>
Date
Aug 22, 2017, 17:51 UTC
Message-ID
<CAGZ79kbpf-a_ZinPLuPh2Vq629=cQknuLVF-QVwOeae1ZGS2Cw@mail.gmail.com>
In-Reply-To
<D44F6340-9011-4D41-B103-4A61E7248806@gmail.com>

On Tue, Aug 22, 2017 at 7:50 AM, Lars Schneider <larsxschneider@gmail.com> wrote:

Show 10 quoted lines
>
> OK. I change my scripts to use ".active" and it seems to work nicely.
>
> I noticed one oddity, though:
>
> If I clone a repo using `git clone --recursive <url>` then the local
> Git config of the repo gets the following entry:
>
> [submodule]
>         active = .

bb62e0a99f (clone: teach --recurse-submodules to optionally take a pathspec, 2017-03-17) makes it clear that this is intentional for --recurse-submodules, but doesn't exactly state that --recurse will behave the same. The idea here is that at clone time you can already give

    git clone --recurse=:(exclude)sub0 <url> <path>

and have your desired set of submodules there. Combined with the changes in the attr system, b0db704652 (pathspec: allow querying for attributes, 2017-03-13) you could make up things like this:

  $ cat .gitattributes
  /sub0 label0
  /sub1
  /sub2 label1 label2
  /sub3 label1
  /platform-specifc-subs/* label1 label2
and then get a clone via
    git clone --recurse=:(attr:label2). <url> <path>

for example. The labeling via the attributes allows for complex patterns, but a relatively easy command line, that you can share with coworkers.

> Is this intentional? Something in the git/git test harness seems to prevent
> that. I was not able to write a test to replicate the issue.
>
> Any idea?

I do not seem to understand the perceived bug? The setting of submodule.active=<pathspec> seems intentional to me, but how would you not reproduce it? Maybe Brandon has an idea.

Thanks, Stefan

Previous: Lars SchneiderNext: Brandon Williams
Message 36 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.