Re: [PATCH 11/19] bash prompt: use bash builtins to find out current branch
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 9, 2012, 21:25 UTC
- Message-ID
- <7vehqtqc6d.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20120509211143.GE6958@goldbirke>
SZEDER Gábor <szeder@ira.uka.de> writes:
> If the above is right, then we could check with bash builtins whether > HEAD is a symbolic link, which is cheap, and stick to '$(git > symbolic-ref HEAD)' if it is, or use bash builtins if it isn't, right?
Sure. Alternatively, you could run "readlink" on it if that is available built-in, and manipulate the result in string builtins, but that is a b/c slow path anyway, so I wouldn't bother.
Thanks.