From: Junio C Hamano Date: Mon, 05 Jan 2009 03:55:34 GMT Subject: Re: git-branch --print-current Message-ID: <7vsknys8y1.fsf@gitster.siamese.dyndns.org> In-Reply-To: <20090105021832.GA20973@spearce.org> "Shawn O. Pearce" writes: > Junio C Hamano wrote: >> demerphq writes: >> >> > The version im using, from git version 1.6.0.4.724.ga0d3a produces the >> > following error: >> > >> > cut: ./HEAD: No such file or directory >> > >> > when in the .git/refs directory. >> >> Personally, I think you are nuts to be in .git/refs and want to use that >> information for anything useful, but if it is an easy enough fix, a patch >> would be useful. > > I agree, its nuts to be there. But this also does show up in 1.6.1. > What's odd is the output of rev-parse --git-dir is wrong: > > $ cd .git/refs > $ git rev-parse --git-dir > . > > Its *not* ".", its "..", I'm *in* the directory. This throws off > a lot of the other operations we do in __git_ps1, like detecting > the repository state by checking MERGE_HEAD or rebase-apply. > > I think we should fix rev-parse --git-dir if we can, not the bash > completion code. Sigh, yeah, that is what I thought would be happening.