Re: [PATCH 2/4] git-prompt.sh: refactor colored prompt code

2013-06-24 Thread Eduardo R. D'Avila
2013/6/23 SZEDER Gábor sze...@ira.uka.de: I'm wary of relying on tput's availability. It's part of ncurses, which is an essential package in many (most? all?) linux distros, but I don't know how it is with other supported platforms. So I think we'd have to stick to the hard-coded escape

Re: [PATCH 2/4] git-prompt.sh: refactor colored prompt code

2013-06-22 Thread Øystein Walle
Eduardo R. D'Avila erdavila at gmail.com writes: + local c_red='\[\e[31m\]' + local c_green='\[\e[32m\]' + local c_lblue='\[\e[1;34m\]' + local c_clear='\[\e[0m\]' fi - local c_red='\e[31m' - local c_green='\e[32m' - local

Re: [PATCH 2/4] git-prompt.sh: refactor colored prompt code

2013-06-22 Thread Eduardo D'Avila
2013/6/22 Øystein Walle oys...@gmail.com: I've gotten the impression it's better to use tput to generate the escape sequences instead of hardcoding them. So something like: local c_red='\['$(tput setaf 1)'\]' local c_green='\['$(tput setaf 2)'\]' local c_green='\['$(tput setaf 4)'\]' local

[PATCH 2/4] git-prompt.sh: refactor colored prompt code

2013-06-20 Thread Eduardo R. D'Avila
__git_ps1_colorize_gitstring() sets color codes and builds the prompt gitstring. It has duplicated code to handle color codes for bash and zsh shells. __git_ps1() also has duplicated logic to build the prompt gitstring. Remove duplication of logic to build gitstring in