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-toolkitFrom 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