Re: [PATCH 04/12] remote.c: provide per-branch pushremote name
- From
Jeff King <peff@peff.net>
- Date
- May 5, 2015, 19:33 UTC
- Message-ID
- <20150505193339.GF10463@peff.net>
- In-Reply-To
- <CAPig+cT7pSxZahd1hmcwCW8ifZfvQ4YW6L7xXUrD7dTJt76srQ@mail.gmail.com>
On Sun, May 03, 2015 at 12:51:13AM -0400, Eric Sunshine wrote:
Show 9 quoted lines
> > 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 agree it is not so much code, though, and maybe it makes the flow a little clearer. I'll play with it for the re-roll.
-Peff