From: Junio C Hamano Date: Wed, 14 Jan 2015 21:54:26 GMT Subject: Re: [PATCH] blame.c: fix garbled error message Message-ID: In-Reply-To: <20150114204926.GA1155@peff.net> Jeff King writes: > On Wed, Jan 14, 2015 at 09:22:52AM -0800, Junio C Hamano wrote: > ... >> And the result should merge just fine to 'maint'. > > Are we in agreement then that the resulting code with the helper is > actually easier to read? I think replacing the straight ?: lines is, but > I am on the fence on whether: > > const char *x = some_fun(...); > return xstrdup_or_null(x); > > is better or worse than: > > return xstrdup_or_null(some_fun(....)); I think the latter is fine as long as some_fun(...) invocation does not get overly long, and even the longest I saw in refs.c, i.e. return xstrdup_or_null(resolve_ref_unsafe(ref, resolve_flags, sha1, flags)); did not bother me too much.