From: Shawn O. Pearce Date: Mon, 05 Jan 2009 02:18:32 GMT Subject: Re: git-branch --print-current Message-ID: <20090105021832.GA20973@spearce.org> In-Reply-To: <7v1vvitwio.fsf@gitster.siamese.dyndns.org> 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. -- Shawn.