From: Jeff King Date: Fri, 05 Apr 2013 05:45:24 GMT Subject: Re: [PATCH 3/3] diffcore-pickaxe: unify setup and teardown code between log -S/-G Message-ID: <20130405054524.GB12705@sigill.intra.peff.net> In-Reply-To: <7vk3ohedn1.fsf@alter.siamese.dyndns.org> On Thu, Apr 04, 2013 at 10:43:14PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > I notice that you are stuck factoring out not just the setup, but also > > the cleanup, and I wondered if things could be made even simpler by just > > encapsulating the checking logic in a callback; then the setup and > > cleanup flow more naturally, as they are in a single function wrapper. > > > > Like this, which ends up saving 20 lines rather than adding 7: > > Oh, this is one of those many times I am reminded why I love having > you in the reviewer/contributor pool ;-) I didn't actually test that patch beyond compilation (but it's _obviously_ correct, right?), and I'm about to go to bed. Do you want to take care of adapting your commit message to it? -Peff