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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano wrote:

> Jakub Narebski <jnareb@xxxxxxxxx> 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


-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]