Subject: Re: [PATCH v2 12/12] refs: move the remaining ref module declarations to refs.h

From: Junio C Hamano <[email-masked]>
Date: Mon, 15 Jun 2015 11:13:22 -0700

Michael Haggerty <[email-masked]> writes:

> Some functions from the refs module were still declared in cache.h.
> Move them to refs.h.

Yay.  But...

> Add some parameter names where they were missing.

... I do not think some of this is a good change.

> @@ -78,15 +170,15 @@ typedef int each_ref_fn(const char *refname,
>   * modifies the reference also returns a nonzero value to immediately
>   * stop the iteration.
>   */
> -extern int head_ref(each_ref_fn, void *);
> +extern int head_ref(each_ref_fn fn, void *cb_data);

For example, between these two, what did we gain?

Because of their types, it already was clear what the two parameters
are in the original, without noisewords like "fn" (which obviously
stands for a "function", but that is clear due to "each_ref_fn").

> -extern int for_each_glob_ref_in(each_ref_fn, const char *pattern, const char* prefix, void *);
> +extern int for_each_glob_ref_in(each_ref_fn fn, const char *pattern, const char* prefix, void *cb_data);

Likewise for addition of fn and cb_data.

If you really want to make unrelated changes to this file, what you
should fix is to update "const char* prefix" to "const char *prefix"
;-)