Re: [PATCH 04/23] expire_reflog(): remove unused parameter
- From
Michael Haggerty <mhagger@alum.mit.edu>
- Date
- Dec 5, 2014, 12:43 UTC
- Message-ID
- <5481A88A.7050509@alum.mit.edu>
- In-Reply-To
- <20141204232853.GD16345@google.com>
On 12/05/2014 12:28 AM, Jonathan Nieder wrote:> Michael Haggerty wrote:
Show 7 quoted lines
>> It was called "unused", so at least it was self-consistent. > > The missing context is that this was a callback function that had to > match the each_ref_fn signature [...] > > With or without a note in the commit message explaining that, > Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
[...]
>> --- a/builtin/reflog.c >> +++ b/builtin/reflog.c >> @@ -349,7 +349,7 @@ static int push_tip_to_list(const char *refname,
const unsigned char *sha1, int
>> return 0; >> } >> >> -static int expire_reflog(const char *ref, const unsigned char *sha1,
int unused, void *cb_data)
>> +static int expire_reflog(const char *ref, const unsigned char *sha1,
void *cb_data)
Show 6 quoted lines
>> {
>> struct cmd_reflog_expire_cb *cmd = cb_data;
>
> On second thought: why not update the last parameter to be a 'struct
> cmd_reflog_expire_cb *' instead of 'void *' while at it, like this?
> [...]Thanks for the explanation, the review, and the suggestion. I will expand the commit to be "don't implement each_ref_fn anymore" and incorporate all of your suggestions.
Michael
-- Michael Haggerty mhagger@alum.mit.edu