From: Jens Lehmann Date: Mon, 09 Dec 2013 17:27:22 GMT Subject: Re: [PATCH] diff: don't read index when --no-index is given Message-ID: <52A5FD7A.9030801@web.de> In-Reply-To: <20131209151609.GA14841@google.com> Am 09.12.2013 16:16, schrieb Jonathan Nieder: > Thomas Gummerer wrote: > >> git diff --no-index ... currently reads the index, during setup, when >> calling gitmodules_config(). In the usual case this gives us some >> performance drawbacks, > > Makes sense. Hmm, but this will disable the submodule specific ignore configuration options defined in the .gitmodules file, no? (E.g. when diffing two directories containing submodules) >> but it's especially annoying if there is a broken >> index file. > > Is this really a normal case? It makes sense that as a side-effect it > is easier to use "git diff --no-index" as a general-purpose tool while > investigating a broken repo, but I would have thought that quickly > learning a repo is broken is a good thing in any case. But I agree that dying with "index file corrupt" is a bit strange when calling diff with --no-index. Wouldn't adding a "gently" option (which could then warn instead of dying) to gitmodules_config() be a better solution here?