Re: [PATCH] RFC: commit: add a commit.all-ignore-submodules config option
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Jan 4, 2020, 00:45 UTC
- Message-ID
- <20200104004516.GB130883@google.com>
- In-Reply-To
- <20200103120613.1063828-1-marcandre.lureau@redhat.com>
Hi,
Marc-André Lureau wrote:
> One of my most frequent mistake is to commit undesired submodules > changes when doing "commit -a", and I have seen a number of people doing > the same mistake in various projects. I wish there would be a config to > change this default behaviour.
Can you say more about the overall workflow this is part of? What causes the submodules to change state in the first place here?
[...]
> --- a/builtin/commit.c > +++ b/builtin/commit.c
[...]
Show 8 quoted lines
> @@ -1475,6 +1478,11 @@ static int git_commit_config(const char *k, const char *v, void *cb)
> return 0;
> }
>
> + if (!strcmp(k, "commit.all-ignore-submodules")) {
> + commit_all_ignore_submodules = git_config_bool(k, v);
> + return 0;
> + }nit, less important than the comment above: no other config items use this naming scheme. We'd have to come up with a different name if we want to pursue this.
If I want to disable this setting for a particular "git commit" invocation, how do I do that? Typically when adding new settings, we add them first as command-line options and then as a separate followup can introduce configuration to change the defaults.
To summarize: I'm interested in hearing more about the overall workflow so we can make the standard behavior without any special configuration work better for it, too.
Thanks and hope that helps, Jonathan