Re: git-status and git-diff now very slow in project with a submodule

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: git-status and git-diff now very slow in project with a submodule

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:48:50

Andy Parkins [off-list ref] writes:
Also, I don't want *.log, or *.ps -- neither of them is guaranteed to be an 
ignore pattern.  These throw away files have all sorts of names, made up on 
the spot as I'm working, adding them to an ignore file is overkill from my 
point of view.
I've learned to give them names that begin with an unusual letter (in my
case, a colon or a plus sign), way before I started working on git, so the
above is not a very convincing argument at least to me.

In any case, I am a bit torn about this whole issue.

On one hand, scanning for untracked files are not about these *.log cruft,
but to catch mistakes that are caused by new paths that you forgot to add,
and in that sense, uncommitted modifications to a path that happens to be
tracked and a new path that you forgot to add have (semantically) similar
chance of being a mistake that you might want to catch by running "git
status".

On the other hand, adding new paths to an existing project is a rare
event, compared to modifications to existing paths (e.g. even for a
project as small and young as git.git, we have 10x as many revisions as we
have paths), so by definition the chance that you might break others'
builds by forgetting to commit a new file is much smaller than forgetting
to commit necessary changes to existing files.

But ideally you would want your tool to catch mistakes that are rarer, as
you would learn to avoid common mistakes on your own without help from
your tool over time.

At least we should be able to let the users say, with "git status -uno",
"I don't care about untracked and unignored paths; I don't make such a
mistake to forget adding new paths", and optimize the scanning of
submodule directories taking advantage of that statement.  Is there a
fundamental reason why things shouldn't work that way, or is it just a
bug in the current code?

Re: git-status and git-diff now very slow in project with a submodule

From: Jens Lehmann <hidden>
Date: 2016-06-15 22:48:50

Am 21.05.2010 00:59, schrieb Junio C Hamano:
At least we should be able to let the users say, with "git status -uno",
"I don't care about untracked and unignored paths; I don't make such a
mistake to forget adding new paths", and optimize the scanning of
submodule directories taking advantage of that statement.  Is there a
fundamental reason why things shouldn't work that way, or is it just a
bug in the current code?
It works that way since 3bfc450. "git status" (and the diff family when
comparing against the work tree) forks a "git status" for each submodule
that is populated. If the status command in the superproject is started
with "-uno" the same option is used for the "git status" forked in the
populated submodules, so no checking for untracked files is done in that
case.

But that doesn't speed up that process much, as the tracked files inside
the submodules have to be checked for modifications anyway, no matter if
"-uno" is used or not. Getting rid of the fork of a new "git status" by
using an alternate odb is on my to do list. Apart from gaining some time
by avoiding the fork (which is a per-submodule-constant) we could terminate
early in case we find a modification (instead of continuing as the current
approach does). But only dirty submodules would profit from that, a clean
submodule won't be scanned much faster that way AFAICS.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help