Re: [PATCH 04/12] remote.c: provide per-branch pushremote name

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

 



On Tue, May 5, 2015 at 3:33 PM, Jeff King <peff@xxxxxxxx> wrote:
> On Sun, May 03, 2015 at 12:51:13AM -0400, Eric Sunshine wrote:
>
>> > Versus v1, I did something a little clever by passing a function pointer
>> > around (versus a flag and letting the caller do a conditional based on
>> > the flag). Too clever?
>>
>> FWIW: I found this "clever" version easy enough to follow.
>>
>> However, if you push a tiny bit of the work into the callers of
>> remote_get_1(), then you can do away with the "cleverness" altogether,
>> can't you? Something like this:
>
> Yeah, it's just that it goes in the opposite direction I was trying for,
> which is to have as little code as possible in the wrapper functions (in
> fact, I think after my changes you could even bump the read_config()
> call into remote_get_1; before my changes, it depended on the pushremote
> config being set before the call).

I also noticed that read_config() could be moved into remote_get_1().
In fact, with that change, then the wrappers really do collapse nicely
to 1-liners, so the "clever" function pointer approach probably is
cleaner; and it's nicely generalized over the previous round with the
boolean argument to remote_get_1().
--
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]