From: Josh England Date: Fri, 07 Sep 2007 22:11:04 GMT Subject: Re: how to access working tree from .git dir? Message-ID: <1189203064.15140.2.camel@beauty> In-Reply-To: <7vhcm62lru.fsf@gitster.siamese.dyndns.org> On Fri, 2007-09-07 at 14:44 -0700, Junio C Hamano wrote: > Josh England writes: > > > ... there doesn't seem to be a > > good way to access the top of the working tree from within the GIT_DIR. > > Since I now know that post-receive has a CWD in .git, I could just use > > `pwd`/../ , but I was hoping for a better (read: consistent between > > hooks) solution. > > I do not think it is a bad thing for _your_ script to have the > knowledge that in _your_ repositories everywhere, the top of the > work tree is $GIT_DIR/.. and there is no repository that lacks a > work tree. Obviously that would not work for people with bare > repositories, but they would not be using _your_ script in their > bare repositories, so that is Ok. OK. Fair enough. Maybe it would be good to note in git-sh-setup.sh that many of the supplied functions will not work when called from within $GIT_DIR. -JE