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

Re: [PATCH] push: change submodule default to check

From
Stefan Beller <sbeller@google.com>
Date
Oct 4, 2016, 18:05 UTC
Message-ID
<CAGZ79kb=q9vCMxKTCfuGGDZdHMdAmh5RP0KN=vCbSS=oerPH3Q@mail.gmail.com>
In-Reply-To
<xmqqfuocuh92.fsf@gitster.mtv.corp.google.com>
On Tue, Oct 4, 2016 at 11:00 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 7 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>> +static void preset_submodule_default(void)
>> +{
>> +     if (file_exists(".gitmodules"))
>
> Don't we need to see if we are in a bare repository?

See discussion with Jeff; instead of checking the file, we rather want to check if $GIT_DIR/modules/ is populated, as that is version agnostic ("Was a submodule initialized and fetched at any time in the life time of this repository?"), as well as bare/non-bare agnostic.

Show 6 quoted lines
>
>> +             recurse_submodules = RECURSE_SUBMODULES_CHECK;
>> +     else
>> +             recurse_submodules = RECURSE_SUBMODULES_DEFAULT;
>
> Hmph, why "_DEFAULT" not "_OFF"?

You answered yourself below, and that was indeed my thought. I was also wondering whether to remove the else, but then I thought that we'd rather do not want to rely on compiled-in at all, and have one init function which sets out the new world order.

Previous: Junio C Hamano
Message 31 of 31 in “Slow pushes on 'pu' - even when up-to-date..”
  1. Linus TorvaldsOct 3, 2016
  2. Stefan BellerOct 3, 2016
  3. Stefan BellerOct 3, 2016
  4. Junio C HamanoOct 3, 2016
  5. Heiko VoigtOct 4, 2016
  6. Jeff KingOct 4, 2016
  7. Heiko VoigtOct 4, 2016
  8. Jeff KingOct 4, 2016
  9. Junio C HamanoOct 4, 2016
  10. Jeff KingOct 4, 2016
  11. push: change submodule default to checkStefan Beller, Oct 4, 2016
  12. Jeff KingOct 4, 2016
  13. Stefan BellerOct 4, 2016
  14. Jeff KingOct 4, 2016
  15. Junio C HamanoOct 4, 2016
  16. Stefan BellerOct 4, 2016
  17. Jeff KingOct 4, 2016
  18. 1/2 push: change submodule default to check when submodules existStefan Beller, Oct 4, 2016
  19. 2/2 builtin/push: move flags do_pushStefan Beller, Oct 4, 2016
  20. Jeff KingOct 4, 2016
  21. Stefan BellerOct 4, 2016
  22. 1/2 push: change submodule default to check when submodules existStefan Beller, Oct 4, 2016
  23. Heiko VoigtOct 5, 2016
  24. Heiko VoigtOct 6, 2016
  25. Stefan BellerOct 6, 2016
  26. Heiko VoigtOct 7, 2016
  27. Jeff KingOct 5, 2016
  28. Stefan BellerOct 5, 2016
  29. Junio C HamanoOct 4, 2016
  30. Junio C HamanoOct 4, 2016
  31. Stefan BellerOct 4, 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.