Re: [PATCH v6] submodule: add 'deinit' command

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

 



On Tue, Mar 05, 2013 at 07:45:22AM -0800, Junio C Hamano wrote:
> Heiko Voigt <hvoigt@xxxxxxxxxx> writes:
> 
> >> +			if test -z "$force"
> >> +			then
> >> +				git rm -n "$sm_path" ||
> >> +				die "$(eval_gettext "Submodule work tree '\$sm_path' contains local modifications; use '-f' to discard them")"
> >
> > Minor nit. IMO, there is an indentation for the || missing here. Maybe
> > Junio can squash that in on his side?
> 
> Sorry, but I do not see an indentation nit here.  The format looks
> perfectly sane to me and in fact any other indentation would be
> wrong.
> 
> Puzzled...

Wouldn't you write this code snippet like this to make clear that there
is another conditional?

	if test -z "$force"
	then
		git rm -n "$sm_path" ||
			die "$(eval_gettext "Submodule work tree '\$sm_path' contains local modifications; use '-f' to discard them")"

It seems it is not clear in the code base either. Some places do
some do not indent:

  git grep -A 1 '||' *.sh

Except for the testsuite I just assumed that this style was common,
because for me it makes the code much easier to read.

It seems it is not, so forget my comment.

Cheers Heiko
--
To unsubscribe from this list: 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]