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

[RFC PATCH v2 0/4] share a config between submodule and superproject

From
Emily Shaffer <emilyshaffer@google.com>
Date
Apr 23, 2021, 00:15 UTC
Message-ID
<20210423001539.4059524-1-emilyshaffer@google.com>
In-Reply-To
<20210408233936.533342-1-emilyshaffer@google.com>
Hi all,

With the second iteration, I bothered to make the tests pass (oops) - and I'm actually fairly unhappy with what I found. Patches 2 and 3 of this iteration clean up tests which were (accidentally) explicitly checking that no child processes were invoked besides the ones they expected, by way of strictly grepping traces (by test_cmp or by line counting). I don't like those tests as they were - to me, they felt like the brittle kind of white-box test - but I also got a stronger feeling that adding an additional child process or two during every Git invocation is a bad idea. I also saw a pretty significant increase in test run time:

All tests successful.
Files=927, Tests=24148, 693 wallclock secs ( 8.71 usr  2.05 sys +
3254.41 cusr 1571.78 csys = 4836.95 CPU)
Result: PASS

real 11m33.029s user 54m23.187s sys 26m13.857s

vs before:
All tests successful.
Files=926, Tests=24138, 144 wallclock secs ( 8.14 usr  2.03 sys + 882.29
cusr 535.61 csys = 1428.07 CPU)
Result: PASS

real 2m24.116s user 14m50.499s sys 8m57.649s

And that's on a Linux machine; as I understand it, invoking child processes can be even more painful on other operating systems.

If we could be assured that this extra step (finding the parent's gitdir and checking that config) was only running when we know we're in a submodule, I'd be less worried, I think. And there are a couple other pieces in the big picture submodule plan I sent[1] around which would require repos to answer "am I a submodule?"

So I think this series may need to be shelved pending an answer to that question - whether we *should* let submodules know they are submodules[2] to turn on more behavior, and if so, how we should implement that.

 - Emily

[1] https://lore.kernel.org/git/YHofmWcIAidkvJiD@google.com [2] https://lore.kernel.org/git/xmqqk0pbm6qt.fsf@gitster.g

Emily Shaffer (4):
  config: rename "submodule" scope to "gitmodules"
  t1510-repo-setup: don't use exact matching on traces
  t7006-pager.sh: more lenient trace checking
  config: add 'config.superproject' file
 Documentation/git-config.txt   |  21 +++++-
 builtin/config.c               |   9 ++-
 config.c                       |  28 +++++++-
 config.h                       |   5 +-
 submodule-config.c             |   2 +-
 submodule.c                    |  29 +++++++++
 submodule.h                    |   8 +++
 t/t1311-superproject-config.sh | 116 +++++++++++++++++++++++++++++++++
 t/t1510-repo-setup.sh          |   2 +-
 t/t7006-pager.sh               |  24 +++++--
 10 files changed, 230 insertions(+), 14 deletions(-)
 create mode 100755 t/t1311-superproject-config.sh
-- 
2.31.1.498.g6c1eba8ee3d-goog
Previous: Junio C HamanoNext: Emily Shaffer
Message 13 of 22 in “share a config between submodule and superproject”
  1. 0/2 share a config between submodule and superprojectEmily Shaffer, Apr 8, 2021
  2. 1/2 config: rename "submodule" scope to "gitmodules"Emily Shaffer, Apr 8, 2021
  3. 2/2 config: add 'config.superproject' fileEmily Shaffer, Apr 8, 2021
  4. Philip OakleyApr 9, 2021
  5. Emily ShafferApr 13, 2021
  6. Matheus Tavares BernardinoApr 9, 2021
  7. Junio C HamanoApr 9, 2021
  8. Emily ShafferApr 13, 2021
  9. Emily ShafferApr 13, 2021
  10. Future structure of submodules and .git/, .git/modules/* organizationÆvar Arnfjörð Bjarmason, Apr 14, 2021
  11. Emily ShafferApr 15, 2021
  12. Junio C HamanoApr 15, 2021
  13. 0/4 share a config between submodule and superprojectEmily Shaffer, Apr 23, 2021
  14. 1/4 config: rename "submodule" scope to "gitmodules"Emily Shaffer, Apr 23, 2021
  15. Phillip WoodApr 23, 2021
  16. 2/4 t1510-repo-setup: don't use exact matching on tracesEmily Shaffer, Apr 23, 2021
  17. Phillip WoodApr 23, 2021
  18. 3/4 t7006-pager.sh: more lenient trace checkingEmily Shaffer, Apr 23, 2021
  19. Phillip WoodApr 23, 2021
  20. Phillip WoodApr 23, 2021
  21. 4/4 config: add 'config.superproject' fileEmily Shaffer, Apr 23, 2021
  22. Johannes SchindelinApr 23, 2021

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.