Thread (2 messages) 2 messages, 2 authors, 2016-06-15

Re: [PATCH] shell-prompt: clean up nested if-then

From: Simon Oosthoek <hidden>
Date: 2016-06-15 22:56:11

On 19/02/13 00:07, Junio C Hamano wrote:
I think you are misreading a suggestion that is somewhat misguided
(yes "[ <condition> && <another> ]" does not make sense, but that is
not applicable to "test <conditon> && test <another>"); ignore it.

It is fine to write "test <condition> && test <another>" and that
works portably to even pre-posix systems.
(that's like doing "ls file && rm file" )
But the existing code the patch touches favors [] over test
consistently; that alone is a good reason to stick with [] in _this_
script, even though it is against Git's overall shell script style.
I suppose it would be fine if a patch was sent to update the entire
git-prompt.sh code to be more in line with the Git shell script style...

My original gripe was just with doing it in one place while leaving all
the others unchanged. It makes for messy reading and leads to confusion.

Cheers

Simon
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help