Re: [WIP/PATCH v4 6/8] for-each-ref: rename some functions and make them public
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 31, 2015, 17:54 UTC
- Message-ID
- <xmqqiob8aazn.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CAP8UFD080Yuv-CYcDzAG0u6OV7Sqry=0s1HKoJbt5wfKjTNO3Q@mail.gmail.com>
Christian Couder <christian.couder@gmail.com> writes:
Show 6 quoted lines
> On Sat, May 30, 2015 at 7:53 PM, Karthik Nayak <karthik.188@gmail.com> 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.