From: Shawn O. Pearce Date: Wed, 11 Feb 2009 18:07:05 GMT Subject: Re: [PATCH 2/4] completion: Use consistent if [...] convention. No test. Message-ID: <20090211180705.GL30949@spearce.org> In-Reply-To: <1234375406-27099-3-git-send-email-ted@tedpavlic.com> Ted Pavlic 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 > --- > 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.