Subject: Re: [PATCH 2/2] branch, for-each-ref: add option to omit empty lines

From: Junio C Hamano <[email-masked]>
Date: Thu, 30 Mar 2023 10:21:19 -0700

Øystein Walle <[email-masked]> writes:

> The logic is more or less duplicated in branch.c and for-each-ref.c
> which I don't like. However I couldn't really find a "central" place to
> put it. Imo. it's definitely not a property of the format or the filter,
> so struct ref_format and struct ref_filter are no good.

I think the division of labor is very much in line with how the
ref-filter API is currently laid out.  Enumerating is done calling
filter_refs(), and result is returned in an array, which the caller
adds whatever frills around its elements to show them in the output.
The "adding frills" is aided by calling format_ref_array_item(), but
the API does not care how the formatting result is used.