git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Beller <sbeller@google.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Sebastian Schuberth <sschuberth@gmail.com>,
	Jacob Keller <jacob.keller@gmail.com>, Jeff King <peff@peff.net>,
	Git Mailing List <git@vger.kernel.org>,
	Jens Lehmann <Jens.Lehmann@web.de>
Subject: Re: diff.ignoreSubmoudles config setting broken?
Date: Wed, 8 Mar 2017 14:11:05 -0800	[thread overview]
Message-ID: <CAGZ79kZFGP0zMP5CtOH3poU9vx8FoT25UVr8ridQo0_VdH2cmA@mail.gmail.com> (raw)
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:
> 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

  reply	other threads:[~2017-03-08 22:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08 12:54 diff.ignoreSubmoudles config setting broken? Sebastian Schuberth
2017-03-08 13:33 ` Jeff King
2017-03-08 13:43   ` Sebastian Schuberth
2017-03-08 14:01     ` Jeff King
2017-03-08 15:07       ` Sebastian Schuberth
2017-03-08 19:04         ` Stefan Beller
2017-03-08 20:54           ` Junio C Hamano
2017-03-08 22:11             ` Stefan Beller [this message]
2017-03-08 23:08               ` Junio C Hamano
2017-03-09  1:30                 ` Stefan Beller
2017-03-09 16:15             ` Sebastian Schuberth
2017-03-08 22:27           ` Jacob Keller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGZ79kZFGP0zMP5CtOH3poU9vx8FoT25UVr8ridQo0_VdH2cmA@mail.gmail.com \
    --to=sbeller@google.com \
    --cc=Jens.Lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jacob.keller@gmail.com \
    --cc=peff@peff.net \
    --cc=sschuberth@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).