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 : > 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 sequences as a fal

Re: [PATCHv3 00/16] bash prompt speedup

2013-06-24 Thread Eduardo R. D'Avila
2013/6/24 SZEDER Gábor : > This patch series will conflict with Eduardo's work on refactoring the > colorizing function, and the conflict is not trivial. Although there > are still some open questions left with that series (using tput, zsh > tests), those won't affect the conflicts between the two

[PATCH v2 0/5] git-prompt: cleaning and improvement

2013-06-25 Thread Eduardo R. D'Avila
d. Thanks, Eduardo [1] http://thread.gmane.org/gmane.comp.version-control.git/228566 [2] http://article.gmane.org/gmane.comp.version-control.git/228705 [3] http://article.gmane.org/gmane.comp.version-control.git/228707 [4] http://thread.gmane.org/gmane.comp.version-control.git/228851 Eduardo R. D

[PATCH v2 1/5] t9903: add tests for git-prompt pcmode

2013-06-25 Thread Eduardo R. D'Avila
git-prompt.sh lacks tests for PROMPT_COMMAND mode. Add tests for: * pcmode prompt without colors * pcmode prompt with colors for bash * pcmode prompt with colors for zsh Having these tests enables an upcoming refactor in a safe way. Signed-off-by: Eduardo R. D'Avila --- 254 0 t/

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

2013-06-25 Thread Eduardo R. D'Avila
__git_ps1_colorize_gitstring() and __git_ps1(). Leave in __git_ps1_colorize_gitstring() only logic to set color codes. Signed-off-by: Eduardo R. D'Avila --- 26 59 contrib/completion/git-prompt.sh contrib/completion/git-prompt.sh | 85 1 file changed, 26 insertions(+

[PATCH v2 3/5] t9903: remove redundant tests

2013-06-25 Thread Eduardo R. D'Avila
After refactoring __git_ps1_colorize_gitstring, codepaths for bash and zsh became mostly common and tests for bash and zsh became redundant. Remove tests for zsh. Keep one minimal test that stress the difference in codepaths for bash and zsh. Suggested-by: SZEDER Gábor Signed-off-by: Eduardo R

[PATCH v2 4/5] git-prompt.sh: do not print duplicate clean color code

2013-06-25 Thread Eduardo R. D'Avila
Do not print a duplicate clean color code when there is no other indicators other than the current branch in colored prompt. Acked-by: SZEDER Gábor Signed-off-by: Eduardo R. D'Avila --- 1 1 contrib/completion/git-prompt.sh 4 4 t/t9903-bash-prompt.sh contrib/compl

[PATCH v2 5/5] git-prompt.sh: add missing information in comments

2013-06-25 Thread Eduardo R. D'Avila
lored prompt is only available in PROMPT_COMMAND/precmd mode. With-suggestions-by: SZEDER Gábor Signed-off-by: Eduardo R. D'Avila --- 15 11 contrib/completion/git-prompt.sh contrib/completion/git-prompt.sh | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions

Re: [PATCH v2 0/5] git-prompt: cleaning and improvement

2013-06-27 Thread Eduardo R. D'Avila
Hi Junio, The merged result is ok! Thanks, Eduardo -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] prompt: do not double-discriminate detached HEAD

2013-07-07 Thread Eduardo R. D'Avila
has a side-effect because color is not possible in non-pc mode, even if GIT_PS1_SHOWCOLORHINTS is defined. (Non-pc mode with GIT_PS1_SHOWCOLORHINTS defined would make the detached HEAD not be shown neither in red nor within parenthesis). Regards, Eduardo R. D'Avila -- To unsubscribe from this l

[PATCH/RFC 0/3] enable color prompt in non-pcmode

2013-06-16 Thread Eduardo R. D'Avila
gitstring and color codes. Prior to enable colors in non-pcmode, refactor __git_ps1() and __git_ps1_colorize_gitstring(). Eduardo R. D'Avila (3): t9903: add tests for git-prompt pcmode git-prompt.sh: refactor colored prompt code git-prompt.sh: enable color prompt in non-pcmode co

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

2013-06-16 Thread Eduardo R. D'Avila
to build gitstring in __git_ps1_colorize_gitstring() and __git_ps1(). Leave in __git_ps1_colorize_gitstring() only logic to set color codes. Signed-off-by: Eduardo R. D'Avila --- 26 59 contrib/completion/git-prompt.sh 6 6 t/t9903-bash-prompt.sh contrib/completio

[PATCH/RFC 3/3] git-prompt.sh: enable color prompt in non-pcmode

2013-06-16 Thread Eduardo R. D'Avila
The use of colors in a prompt is only possible in pcmode (using the variable PROMPT_COMMAND). Enable color prompt in non-pcmode (using the variable PS1) for both Bash and ZSH. Signed-off-by: Eduardo R. D'Avila --- 15 9 contrib/completion/git-prompt.sh 19 0 t/t9903

[PATCH/RFC 1/3] t9903: add tests for git-prompt pcmode

2013-06-16 Thread Eduardo R. D'Avila
git-prompt.sh lacks tests for PROMPT_COMMAND mode. Add tests for: * pcmode prompt without colors * pcmode prompt with colors for bash * pcmode prompt with colors for zsh Having these tests enables an upcoming refactor in a safe way. Signed-off-by: Eduardo R. D'Avila --- 250 0 t/

[PATCH v2 1/3] t9903: add tests for git-prompt pcmode

2013-06-17 Thread Eduardo R. D'Avila
git-prompt.sh lacks tests for PROMPT_COMMAND mode. Add tests for: * pcmode prompt without colors * pcmode prompt with colors for bash * pcmode prompt with colors for zsh Having these tests enables an upcoming refactor in a safe way. Signed-off-by: Eduardo R. D'Avila --- 254 0 t/

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

2013-06-17 Thread Eduardo R. D'Avila
__git_ps1_colorize_gitstring() and __git_ps1(). Leave in __git_ps1_colorize_gitstring() only logic to set color codes. Signed-off-by: Eduardo R. D'Avila --- 26 59 contrib/completion/git-prompt.sh 6 6 t/t9903-bash-prompt.sh contrib/completion/git-prompt.sh

[PATCH 3/3] git-prompt.sh: enable color prompt in non-pcmode

2013-06-17 Thread Eduardo R. D'Avila
The use of colors in a prompt is only possible in pcmode (using the variable PROMPT_COMMAND). Enable color prompt in non-pcmode (using the variable PS1) for both Bash and ZSH. Signed-off-by: Eduardo R. D'Avila --- 15 9 contrib/completion/git-prompt.sh 19 0 t/t9903

[PATCH v2 3/3] git-prompt.sh: enable color prompt in non-pcmode

2013-06-17 Thread Eduardo R. D'Avila
The use of colors in a prompt is only possible in pcmode (using the variable PROMPT_COMMAND). Enable color prompt in non-pcmode (using the variable PS1) for both Bash and ZSH. Signed-off-by: Eduardo R. D'Avila --- 15 9 contrib/completion/git-prompt.sh 19 0 t/t9903

[PATCH 1/4] t9903: add tests for git-prompt pcmode

2013-06-20 Thread Eduardo R. D'Avila
git-prompt.sh lacks tests for PROMPT_COMMAND mode. Add tests for: * pcmode prompt without colors * pcmode prompt with colors for bash * pcmode prompt with colors for zsh Having these tests enables an upcoming refactor in a safe way. Signed-off-by: Eduardo R. D'Avila --- 254 0 t/

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

2013-06-20 Thread Eduardo R. D'Avila
__git_ps1_colorize_gitstring() and __git_ps1(). Leave in __git_ps1_colorize_gitstring() only logic to set color codes. Signed-off-by: Eduardo R. D'Avila --- 26 59 contrib/completion/git-prompt.sh contrib/completion/git-prompt.sh | 85 1 file changed, 26 insertions(+

[PATCH 3/4] git-prompt.sh: do not print duplicate clean color code

2013-06-20 Thread Eduardo R. D'Avila
Do not print a duplicate clean color code when there is no other indicators other than the current branch in colored prompt. Signed-off-by: Eduardo R. D'Avila --- 1 1 contrib/completion/git-prompt.sh 6 6 t/t9903-bash-prompt.sh contrib/completion/git-prompt.sh | 2

[PATCH 0/4] git-prompt: cleaning and improvement

2013-06-20 Thread Eduardo R. D'Avila
-control.git/228308 . Some of the patches could still be used, so I'm reposting them with an additional one to add some missing information in usage comments. Eduardo R. D'Avila (4): t9903: add tests for git-prompt pcmode git-prompt.sh: refactor colored prompt code git-prompt.

[PATCH 4/4] git-prompt.sh: add missing information in comments

2013-06-20 Thread Eduardo R. D'Avila
Mention that the command below is needed for prompt in ZSH with PS1: setopt PROMPT_SUBST Make it clear that colored prompt is only available in PROMPT_COMMAND mode. Signed-off-by: Eduardo R. D'Avila --- 5 4 contrib/completion/git-prompt.sh contrib/completion/git-prompt.s