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

Re: [PATCH] submodule.h: use a named enum for RECURSE_SUBMODULES_*

From
Glen Choo <chooglen@google.com>
Date
Jan 7, 2022, 17:43 UTC
Message-ID
<kl6lczl3786k.fsf@chooglen-macbookpro.roam.corp.google.com>
In-Reply-To
<3160705c-d95c-c389-e929-f1f6bbcd80fc@gmail.com>
Philippe Blain <levraiphilippeblain@gmail.com> writes:
Show 20 quoted lines
>> 
>> That is, many changes like this one.
>> 
>> diff --git i/builtin/pull.c w/builtin/pull.c
>> index c8457619d8..f2fd4784df 100644
>> --- i/builtin/pull.c
>> +++ w/builtin/pull.c
>> @@ -71,7 +71,7 @@ static const char * const pull_usage[] = {
>>   /* Shared options */
>>   static int opt_verbosity;
>>   static char *opt_progress;
>> -static int recurse_submodules = RECURSE_SUBMODULES_DEFAULT;
>> +static enum submodule_recurse_mode recurse_submodules = RECURSE_SUBMODULES_DEFAULT;
>>   
>>   /* Options passed to git-merge or git-rebase */
>>   static enum rebase_type opt_rebase = -1;
>> 
>
> Yes, this is a parallel effort that could be done, I agree, but my patch
> was meant to help in the mean time.

There are quite a few sites that could use this s/int/enum submodule_recurse_mode change. I suppose one _could_ change all of them at once, but that seems cumbersome to review and prone to conflict.

So that this isn't debugger-only, I'd be happy with at least one change (perhaps the one that inspired you to name the enum in the first place), and making the other changes when it makes sense, e.g. I can do this for the fetch machinery while I work on enhancements to `fetch --recurse-submodules`.

Previous: Philippe BlainNext: Glen Choo
Message 4 of 7 in “submodule.h: use a named enum for RECURSE_SUBMODULES_*”
  1. submodule.h: use a named enum for RECURSE_SUBMODULES_*Philippe Blain via GitGitGadget, Jan 5, 2022
  2. Junio C HamanoJan 5, 2022
  3. Philippe BlainJan 7, 2022
  4. Glen ChooJan 7, 2022
  5. Glen ChooJan 18, 2022
  6. submodule.h: use a named enum for RECURSE_SUBMODULES_*Philippe Blain via GitGitGadget, Apr 4, 2022
  7. Glen ChooApr 4, 2022

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.