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

Re: diff.ignoreSubmoudles config setting broken?

From
Stefan Beller <sbeller@google.com>
Date
Mar 8, 2017, 22:11 UTC
Message-ID
<CAGZ79kZFGP0zMP5CtOH3poU9vx8FoT25UVr8ridQo0_VdH2cmA@mail.gmail.com>
In-Reply-To
<xmqq8tof32x9.fsf@gitster.mtv.corp.google.com>
On Wed, Mar 8, 2017 at 12:54 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 21 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>> On Wed, Mar 8, 2017 at 7:07 AM, Sebastian Schuberth
>> <sschuberth@gmail.com> wrote:
>>>
>>> + Jens
>>>
>>
>> + Jacob Keller, who touched submodule diff display code last.
>> (I am thinking of fd47ae6a, diff: teach diff to display submodule
>> difference with an inline diff, 2016-08-31), which is first release as
>> part of v2.11.0 (that would fit your observance)
>
> Between these two:
>
>         git -c diff.ignoresubmodules=all diff
>         git diff --ignore-submodules=all
>
> one difference is that the latter disables reading extra config from
> .gitmodules (!) while the former makes the command honor it.
>
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

It is not clear to me how a specific setting in .gitmodules would interact with a submodule-global setting in the config, e.g.

  git config -f .gitmodules submodule. \
      "$(git submodule--helper name scanners/scancode-toolkit)". \
      ignore none
  git config diff.ignoreSubmodules all
  git diff  scanners/scancode-toolkit

From reading the code, I assume "diff.ignoreSubmodules all" takes precedence here nevertheless because the diff.ignoreSubmodules setting is treated on a higher level than the submodule specific setting, despite the submodule specific setting being more specific.

This is a bad example, because it may be intuitive that the value in the .git/config file takes precedence over .gitmodules, but we cannot set diff.ignoreSubmodules in .gitmodules.

Stefan
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 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.