Re: [PATCH] blame.c: fix garbled error message
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 14, 2015, 21:54 UTC
- Message-ID
- <xmqqsifd81v1.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <20150114204926.GA1155@peff.net>
Jeff King <peff@peff.net> writes:
Show 14 quoted lines
> 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.