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

Re: diff.ignoreSubmoudles config setting broken?

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 8, 2017, 23:08 UTC
Message-ID
<xmqqa88v1i5f.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAGZ79kZFGP0zMP5CtOH3poU9vx8FoT25UVr8ridQo0_VdH2cmA@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 13 quoted lines
> Yeah the .gitmodules file is a good hint.
>
> Here is my understanding of the precedence:
>
>   command line options > .git/config (in various forms) > .gitmodules
>
> where in the .git config we have precedence levels for different files
>
>   .git/config > ~/.gitconfig
>
> as well as different settings:
>
>   submodule.<name>.ignore > diff.ignoreSubmodules

I've never understood why people thought it a good idea to let .gitmodules supplied by the upstream override the configuration setting the end user has like this. This is quite bad.

Perhaps this is a good starting point?
 diff.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/diff.c b/diff.c
index a628ac3a95..75b7140c63 100644
--- a/diff.c
+++ b/diff.c
@@ -273,8 +273,11 @@ int git_diff_ui_config(const char *var, const char *value, void *cb)
 	if (!strcmp(var, "diff.orderfile"))
 		return git_config_pathname(&diff_order_file_cfg, var, value);
 
-	if (!strcmp(var, "diff.ignoresubmodules"))
+	if (!strcmp(var, "diff.ignoresubmodules")) {
 		handle_ignore_submodules_arg(&default_diff_options, value);
+		DIFF_OPT_SET(options, OVERRIDE_SUBMODULE_CONFIG);
+		return 0;
+	}
 
 	if (!strcmp(var, "diff.submodule")) {
 		if (parse_submodule_params(&default_diff_options, value))
Previous: Stefan BellerNext: Stefan Beller
Message 9 of 12 in “diff.ignoreSubmoudles config setting broken?”
  1. Sebastian SchuberthMar 8, 2017
  2. Jeff KingMar 8, 2017
  3. Sebastian SchuberthMar 8, 2017
  4. Jeff KingMar 8, 2017
  5. Sebastian SchuberthMar 8, 2017
  6. Stefan BellerMar 8, 2017
  7. Junio C HamanoMar 8, 2017
  8. Stefan BellerMar 8, 2017
  9. Junio C HamanoMar 8, 2017
  10. Stefan BellerMar 9, 2017
  11. Sebastian SchuberthMar 9, 2017
  12. Jacob KellerMar 8, 2017

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.