From: Aaron Schrab Date: Thu, 06 Oct 2011 22:57:40 GMT Subject: Re: Git Bug report Message-ID: <20111006225740.GG24640@pug.qqx.org> In-Reply-To: <7vy5wy145q.fsf@alter.siamese.dyndns.org> At 09:22 -0700 06 Oct 2011, Junio C Hamano wrote: >Yeah, after thinking about it a bit more, whenever we see ".git" during >the upward discovery process, we should always warn if we know it is _not_ >a GIT_DIR before looking for another ".git" at higher levels, as anything >in that directory cannot be added. If we cannot tell if it is or is not >a GIT_DIR, we should error out---the reason we cannot tell most likely is >because we cannot read it, and such a file, if it is not a GIT_DIR, cannot >be tracked in the real GIT_DIR at a higher level, and if it is a GIT_DIR, >we cannot use it to record updates or inspect existing history. Yes, I think that sounds like a good idea. That should also solve a related problem that I noticed while checking out the current behaviour. Currently if the .git directory of a submodule is inaccessible running `git status` from anywhere in the parent repository (including within the submodule) will cause git to recursively call itself until enough resources are used to prevent further forking. I then tried this with the patch from earlier in the thread applied, but with the call to error() changed to call die() instead. With that change it quickly failed with a useful error message.