On 16/10/12 23:30, Junio C Hamano wrote: > Simon Oosthoek <s.oosthoek@xxxxxxxxx> writes: > >> Hi >> >> Fixed the mistakes of the last one, and I'm now using the symbolic names "ok_color" and "bad_color". >> The test for headless state is now more direct, and I hope it is still correct. >> >> /Simon > > Will apply with a bit more readable log message. Ok > > I think it would be a good idea to squash something like the > attached into this patch, though. I tried the patch and it works when you switch the color assignments in the if statement you added... > @@ -264,7 +264,7 @@ __git_ps1 () > fi > > b="$(git symbolic-ref HEAD 2>/dev/null)" || { > - > + detached=yes > b="$( > case "${GIT_PS1_DESCRIBE_STYLE-}" in > (contains) > @@ -335,8 +335,7 @@ __git_ps1 () > local flags_color="$c_lblue" > local branchstring="$c${b##refs/heads/}" > > - if git symbolic-ref HEAD 2>/dev/null 1>&2 > - then > + if [ $detached = yes ]; then - branch_color="$ok_color" + branch_color="$bad_color" > else - branch_color="$bad_color" + branch_color="$ok_color" if detached = yes, then bad_color should be applied, else use ok_color. Cheers Simon -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html