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

Re: [RFC PATCH v2 1/4] config: rename "submodule" scope to "gitmodules"

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Apr 23, 2021, 09:46 UTC
Message-ID
<8d27af1f-7fa3-e3a7-f042-2559fc24bc18@gmail.com>
In-Reply-To
<20210423001539.4059524-2-emilyshaffer@google.com>
Hi Emily
On 23/04/2021 01:15, Emily Shaffer wrote:
> To prepare for the addition of a new config scope which only applies to
> submodule projects, disambiguate "CONFIG_SCOPE_SUBMODULES". This scope
> refers to configs gathered from the .gitmodules file in the
> superproject, so just call it "gitmodules."

Am I right in thinking that this changes the output of `git config --show-scope`? If so I'm not sure it's a good idea as it would break any scripts that are parsing that output

Best Wishes
Phillip
Show 49 quoted lines
> Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
> ---
>   config.c           | 4 ++--
>   config.h           | 2 +-
>   submodule-config.c | 2 +-
>   3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/config.c b/config.c
> index 870d9534de..c8426ef3f3 100644
> --- a/config.c
> +++ b/config.c
> @@ -3499,8 +3499,8 @@ const char *config_scope_name(enum config_scope scope)
>   		return "worktree";
>   	case CONFIG_SCOPE_COMMAND:
>   		return "command";
> -	case CONFIG_SCOPE_SUBMODULE:
> -		return "submodule";
> +	case CONFIG_SCOPE_GITMODULES:
> +		return "gitmodules";
>   	default:
>   		return "unknown";
>   	}
> diff --git a/config.h b/config.h
> index 19a9adbaa9..535f5517b8 100644
> --- a/config.h
> +++ b/config.h
> @@ -42,7 +42,7 @@ enum config_scope {
>   	CONFIG_SCOPE_LOCAL,
>   	CONFIG_SCOPE_WORKTREE,
>   	CONFIG_SCOPE_COMMAND,
> -	CONFIG_SCOPE_SUBMODULE,
> +	CONFIG_SCOPE_GITMODULES,
>   };
>   const char *config_scope_name(enum config_scope scope);
>   
> diff --git a/submodule-config.c b/submodule-config.c
> index f502505566..0e435e6fdd 100644
> --- a/submodule-config.c
> +++ b/submodule-config.c
> @@ -637,7 +637,7 @@ static void config_from_gitmodules(config_fn_t fn, struct repository *repo, void
>   {
>   	if (repo->worktree) {
>   		struct git_config_source config_source = {
> -			0, .scope = CONFIG_SCOPE_SUBMODULE
> +			0, .scope = CONFIG_SCOPE_GITMODULES
>   		};
>   		const struct config_options opts = { 0 };
>   		struct object_id oid;
> 
Previous: Emily ShafferNext: Emily Shaffer
Message 15 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.