From: Matthias Kestenholz Date: Fri, 19 Jan 2007 13:46:54 GMT Subject: Re: git ls-files -o under .git/ prints all repository files Message-ID: <1169214414.18684.25.camel@localhost.localdomain> In-Reply-To: <45B0C7E6.4020509@op5.se> On Fri, 2007-01-19 at 14:30 +0100, Andreas Ericsson wrote: > Alex Riesen wrote: > > On 1/19/07, Simon 'corecode' Schubert wrote: > >> > > >> > >> % cd .hg && hg status -A . > >> abort: path contains illegal component: .hg > >> > >> I think this is a sensible thing to do. > > > > No, it isn't. It is not unlikely to have repo in repo > > (and some people already have them). > > Mercurial is wrong here. > > For managing repos inside repos (onion repos?) I think it should > be safe to abort if we're not at top-level. > Why not check for /.git/ somewhere inside the current working directory (pwd) ? That's the way mercurial does it currently, and I think that is a sane thing to do _if_ you want to protect the user from his own stupidity.