Re: git-branch --print-current
"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 27 quoted lines
> Junio C Hamano <gitster@pobox.com> wrote:
>> demerphq <demerphq@gmail.com> 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.