Re: [PATCH 04/23] expire_reflog(): remove unused parameter

2014-12-05 Thread Michael Haggerty
On 12/05/2014 12:28 AM, Jonathan Nieder wrote: Michael Haggerty wrote:
 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 jrnie...@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)
  {
  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
mhag...@alum.mit.edu

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 04/23] expire_reflog(): remove unused parameter

2014-12-04 Thread Jonathan Nieder
Michael Haggerty wrote:

 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 (where that parameter is 'flags')
until v1.5.4~14 (reflog-expire: avoid creating new files in a
directory inside readdir(3) loop, 2008-01-25).  v1.5.4~14 forgot to
clean up.

With or without a note in the commit message explaining that,
Reviewed-by: Jonathan Nieder jrnie...@gmail.com
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 04/23] expire_reflog(): remove unused parameter

2014-12-04 Thread Jonathan Nieder
Michael Haggerty wrote:

 --- 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)
  {
   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?

 builtin/reflog.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git i/builtin/reflog.c w/builtin/reflog.c
index 3e11bee..d860624 100644
--- i/builtin/reflog.c
+++ w/builtin/reflog.c
@@ -349,9 +349,8 @@ 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, void 
*cb_data)
+static int expire_reflog(const char *ref, const unsigned char *sha1, struct 
cmd_reflog_expire_cb *cmd)
 {
-   struct cmd_reflog_expire_cb *cmd = cb_data;
struct expire_reflog_cb cb;
struct ref_lock *lock;
char *log_file, *newlog_path = NULL;
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html