Subject: Re: [WIP/PATCH v4 6/8] for-each-ref: rename some functions and make them public

From: Junio C Hamano <[email-masked]>
Date: Sun, 31 May 2015 10:54:36 -0700

Christian Couder <[email-masked]> writes:

> On Sat, May 30, 2015 at 7:53 PM, Karthik Nayak <[email-masked]> wrote:
>>
>> -static void sort_refs(struct ref_sort *sort, struct ref_array *array)
>> +void sort_ref_array(struct ref_sort *sort, struct ref_array *array)
>
> It is probably better to call the above function ref_array_sort()...

Care to explain the reasoning behind that suggestion?  The function
"sorts" "ref_array", so verb-object sounds like a valid construction
of a name.  All the functions externalized by the patch under
discussion follows that pattern, I think (e.g. parse-ref-filter-atom,
verify-ref-format, show-ref-array-item).

Making the API function share a common prefix is another valid
school of design; while that may justify ref-array-sort(), but if
you are going in that direction, all the others need to be renamed
along that line consistently, I would think.