Subject: Re: [PATCH 2/4] completion: Use consistent if [...] convention. No test.

From: "Shawn O. Pearce" <[email-masked]>
Date: Wed, 11 Feb 2009 10:07:05 -0800

Ted Pavlic <[email-masked]> wrote:
> The local coding convention in bash completion is to use [...] rather
> than test. Additionally,
> 
>     if [...]; then
> 
> is preferred over
> 
>     if [...]
>     then
> 
> and so matching "if [...]\nthen" were changed accordingly.
> 
> Signed-off-by: Ted Pavlic <[email-masked]>
> ---
>  contrib/completion/git-completion.bash |   31 +++++++++++--------------------
>  1 files changed, 11 insertions(+), 20 deletions(-)
> 
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 6bbe09a..7706170 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -84,39 +84,30 @@ __git_ps1 ()
>  	if [ -n "$g" ]; then
>  		local r
>  		local b
> -		if [ -d "$g/rebase-apply" ]
> -		then
> -			if test -f "$g/rebase-apply/rebasing"
> -			then
> +		if [ -d "$g/rebase-apply" ]; then
> +			if [ -f "$g/rebase-apply/rebasing" ]; then
>  				r="|REBASE"
> -			elif test -f "$g/rebase-apply/applying"
> -			then
> +            elif [ -f "$g/rebase-apply/applying" ]; then

There is some sort of whitespace damage right here, the elif doesn't
seem to line up correctly.

-- 
Shawn.