Re: [PATCH v4] install_branch_config: simplify verbose messages logic

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

 



Eric Sunshine <sunshine@xxxxxxxxxxxxxx> writes:

> Shouldn't this logic [to decide what the printf arguments should
> be] also be encoded in the table?
> ...
> The same argument also applies to computation of the 'name' variable
> above. It too can be pushed into the the table.

Because the "printf argument" logic does not have to be in the
table, the same argument does not apply to the 'name' thing.

After looking at the v5 patch, I do not think an extra two-element
array to switch between remote vs shortname is making it any easier
to read.  I would have to say that personally I find that

	const char *name[] = {remote, shortname};
	... long swath of code ...
	printf_ln(... name[!remote_is_branch] ...);

is a lot harder to read than:

	printf_ln(... remote_is_branch ? shortname : branch ...);

HTH, and thanks.
--
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]