Re: git-PS1 bash prompt setting

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Nicolas Vilz <niv@...>
Cc: <git@...>, Theodore Tso <tytso@...>
Date: Friday, November 17, 2006 - 5:20 am

On Fri, 17 Nov 2006 09:38:02 +0100
Nicolas Vilz <niv@iaglans.de> wrote:


Sorry bout that, I knew it was a bit fragile.  Was rather
comical reading Junio's recent message about all the things not
to do if you want portable shell code and noticing my 6 line script
did 90% of them ;o)  Strange though, I downloaded Bash 3.2
and gave it a try and didn't see the problem here..

Wanna try this small change, to see if it helps? :

#!/bin/bash
BR=$(git symbolic-ref HEAD 2>/dev/null) || { echo "$@" ; exit ; }
BR=${BR#refs/heads/}
REL=$(git rev-parse --show-prefix)
REL="${REL%\/}"
LOC="${PWD%/$REL}"
echo "[$BR!${LOC/*\/}${REL:+/$REL}]$ "

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: git-PS1 bash prompt setting, Nicolas Vilz, (Fri Nov 17, 4:38 am)
Re: git-PS1 bash prompt setting, Sean, (Fri Nov 17, 5:20 am)
Re: git-PS1 bash prompt setting, Junio C Hamano, (Sun Nov 19, 2:28 am)