Re: [PATCH v2] git-prompt: preserve value of $? inside shell prompt

2015-01-14 Thread Tony Finch
SZEDER Gábor sze...@ira.uka.de wrote: Makes sense, but the patch doesn't cover all cases, because __git_ps1() can exit early Thanks for looking at the patch. I feel quite silly for missing the other return points :-( Follow-up patch on the way... Tony. -- f.anthony.n.finch d...@dotat.at

Re: [PATCH v2] git-prompt: preserve value of $? inside shell prompt

2015-01-13 Thread SZEDER Gábor
Hi, Quoting Tony Finch d...@dotat.at: If you have a prompt which displays the command exit status, __git_ps1 without this change corrupts it, although it has the correct value in the parent shell: ~/src/git (master) 0 $ set | grep ^PS1 PS1='\w$(__git_ps1) $? \$ '

[PATCH v2] git-prompt: preserve value of $? inside shell prompt

2014-12-22 Thread Tony Finch
If you have a prompt which displays the command exit status, __git_ps1 without this change corrupts it, although it has the correct value in the parent shell: ~/src/git (master) 0 $ set | grep ^PS1 PS1='\w$(__git_ps1) $? \$ ' ~/src/git (master) 0 $ false ~/src/git

Re: [PATCH v2] git-prompt: preserve value of $? inside shell prompt

2014-12-22 Thread Junio C Hamano
Tony Finch d...@dotat.at writes: If you have a prompt which displays the command exit status, __git_ps1 without this change corrupts it, although it has the correct value in the parent shell: ~/src/git (master) 0 $ set | grep ^PS1 PS1='\w$(__git_ps1) $? \$ ' ~/src/git

Re: [PATCH v2] git-prompt: preserve value of $? inside shell prompt

2014-12-22 Thread Tony Finch
Junio C Hamano gits...@pobox.com wrote: Yes. I wouldn't have spent 20 minutes experimenting with various hypothetical use cases if the above were there in the first place. Sorry for wasting your time, and thanks for reviewing the patch. (I am so used to having $? in my prompt it took me ages