Subject: Re: [PATCH 1/2] Use tabs for indent in shell scripts

From: Jakub Narebski <[email-masked]>
Date: Tue, 01 Aug 2006 12:01:19 +0200

Junio C Hamano wrote:

> Jakub Narebski <[email-masked]> writes:
> 
>>  if [ -n "$GIT_SSL_NO_VERIFY" ]; then
>> -    curl_extra_args="-k"
>> +    curl_extra_args="-k"
>>  fi
> 
> Things like this makes some sense...
> 
>>              if test -n "$use_separate_remote" &&
>> -               branch_name=`expr "z$name" : 'zheads/\(.*\)'`
>> +                    branch_name=`expr "z$name" : 'zheads/\(.*\)'`
>>              then
> 
> ... but not this, which is not just indent but an alignment.

Sorry, my mistake. Tabs for indent, spaces for align, of course. So discard
this chunk, please.

I'm not sure how to indent sequences like the following:

  command arg \
    arg arg arg \
    arg arg arg

The above I think everybody would agree on.

  command &&
    command &&
    command

  command ||
    command ||
    command

Not so sure about above

[...]
> Also shell scripts tend to become too deeply indented, and 4-column
> indentation helps to keep things within typical screen width.
> 
> In short, not very enthused.

I use tab-width 2 and script didn't get too indented. All changed scripts
except git-clone.sh fit in 80 column window for tab width 2, and the lines
in git-clone.sh which do not fit in 80 columns are not indented at all. 

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git