Re: [PATCH v5 1/5] rebase -i: add --ignore-whitespace flag

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

 



Phillip Wood <phillip.wood123@xxxxxxxxx> writes:

>>>   +	if (options.type == REBASE_APPLY) {
>>> +		if (ignore_whitespace)
>>> +			argv_array_push (&options.git_am_opts,
>>> +					 "--ignore-whitespace");
>>> +	} else if (ignore_whitespace) {
>>> +			string_list_append (&strategy_options,
>>> +					    "ignore-space-change");
>>> +	}
>>> +
>> ...
> I wanted to keep the subsequent patches as simple as possible. Having
> to rewrite the if statement in the next patch just clutters it up and
> makes the real changes introduced by that patch less obvious

A set of different behaviour depending on .type is OK, but then at
least the above should be more like this:

	if (options.type == REBASE_APPLY) {
		if (ignore_whitespace)
			argv_array_push(...);
	} else {
		/* REBASE_MERGE and PRESERVE_MERGES */
		if (ignore_whitespace)
			string_list_append(...);
	}

or even

	switch (options.type) {
	case REBASE_APPLY:
		...
		break;
	case REBASE_MERGE:
	case REBASE_PRESERVE_MERGES:
		...
		break;
	default:
		BUG("unhandled rebase type %d", options.type);
	}

That would clarify the flow of the logic better.

Thanks.



[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]

  Powered by Linux