public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp•fr>
To: Karthik Nayak <karthik.188@gmail•com>
Cc: git@vger•kernel.org, christian.couder@gmail•com
Subject: Re: [PATCH/WIP v3 2/4] for-each-ref: introduce new structures for better organisation
Date: Thu, 28 May 2015 22:26:02 +0200	[thread overview]
Message-ID: <vpqegm0o3dx.fsf@anie.imag.fr> (raw)
In-Reply-To: <1432835025-13291-2-git-send-email-karthik.188@gmail.com> (Karthik Nayak's message of "Thu, 28 May 2015 23:13:43 +0530")

Karthik Nayak <karthik.188@gmail•com> writes:

> Rename 'refinfo' to 'ref_array_item' and intoduce 'ref_filter_cbdata'

The fact that you need to use "and" to describe your changes is a hint
that you can split better.

The patch looks much better, but I think you still need to split more to
make it easier to review.

> - * of properties that we need to extract out of objects.  refinfo
> + * of properties that we need to extract out of objects. ref_array_item

Not very important, but two spaces after a period is what one is
supposed to do in English. Not everybody follow the rule, but it seems
backward to change the code to break it.

>  	if (flag & REF_BAD_NAME) {
> -		  warning("ignoring ref with broken name %s", refname);
> -		  return 0;
> +		warning("ignoring ref with broken name %s", refname);
> +		return 0;

Whitespace fix mixed with actual code.

> -static int cmp_ref_sort(struct ref_sort *s, struct refinfo *a, struct refinfo *b)
> +/* Free all memory allocated for ref_filter_cbdata */
> +void ref_filter_clear_data(struct ref_filter_cbdata *ref_cbdata)
> +{
> +	int i;
> +
> +	for (i = 0; i < ref_cbdata->array.nr; i++)
> +		free(ref_cbdata->array.items[i]);
> +	free(ref_cbdata->array.items);
> +	ref_cbdata->array.items = NULL;
> +	ref_cbdata->array.nr = ref_cbdata->array.alloc = 0;
> +}

And this one is a real behavior change, which would be much better
documented in its own patch with a proper commit message (we had a
memory leak before, we didn't care because it happened right before
exiting, but we can't accept that in a clean library).

Reviewing is not just about having a look and seeing if there's
something stupid. Reviewers are actually taking a lot of time to see if
the patch does not introduce new bugs, or looking for better ways to do
the same thing. Be nice with them!

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

  reply	other threads:[~2015-05-28 20:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 17:38 [PATCH/WIP v3 1/4] for-each-ref: re-structure code for moving to 'ref-filter' Karthik Nayak
2015-05-28 17:43 ` [PATCH/WIP v3 1/4] for-each-ref: extract helper functions out of grab_single_ref() Karthik Nayak
2015-05-28 20:13   ` Matthieu Moy
2015-05-28 20:33     ` Karthik Nayak
2015-05-28 17:43 ` [PATCH/WIP v3 2/4] for-each-ref: introduce new structures for better organisation Karthik Nayak
2015-05-28 20:26   ` Matthieu Moy [this message]
2015-05-28 20:37     ` Karthik Nayak
2015-05-28 20:41       ` Matthieu Moy
2015-05-28 20:43         ` Karthik Nayak
2015-05-28 21:18     ` Junio C Hamano
2015-05-28 21:28       ` Junio C Hamano
2015-05-28 17:43 ` [PATCH/WIP v3 3/4] for-each-ref: rename some functions and make them public Karthik Nayak
2015-05-28 17:43 ` [PATCH/WIP v3 4/4] ref-filter: move code from 'for-each-ref' Karthik Nayak
2015-05-28 20:35   ` Matthieu Moy
2015-05-28 20:46     ` Karthik Nayak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vpqegm0o3dx.fsf@anie.imag.fr \
    --to=matthieu.moy@grenoble-inp$(echo .)fr \
    --cc=christian.couder@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=karthik.188@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox