git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: MustafaOrkunAcar <mustafaorkunacar@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH] Rewritten fetch-pack.c:filter_refs() using starts_with() instead of memcmp()
Date: Fri, 21 Mar 2014 02:27:05 -0400	[thread overview]
Message-ID: <CAPig+cS+6Kg3S+mqLk_9dBdp96M_2L2fgyc1p29irrpmHuLNvA@mail.gmail.com> (raw)
In-Reply-To: <1395309889-340-1-git-send-email-mustafaorkunacar@gmail.com>

Thanks for the submission. Comments below to give you a taste of the
Git review process...

On Thu, Mar 20, 2014 at 6:04 AM, MustafaOrkunAcar
<mustafaorkunacar@gmail.com> wrote:
> Subject: Rewritten fetch-pack.c:filter_refs() using starts_with() instead of memcmp()

Use imperative mood: "Rewrite" rather than "Rewritten". Mention the
module or function you're touching at the start of the subject,
followed by a colon and space. For example:

    Subject: filter_refs: replace memcmp() with starts_with()

> Hi, I have completed one of the microprojects -14th one: "Change fetch-pack.c:filter_refs() to use starts_with() instead of memcmp()." The only line in the function filter_refs() containing memcmp() is changed with starts_with(). I plan to apply for GSoC 2014. Any feedback is appreciated. Thanks.

Wrap text to 65-70 characters.

This area above your sign-off is where you should explain the purpose
of the patch and justify the change. For a small one like this, you
shouldn't need more than one or two simple sentences.

> Signed-off-by: MustafaOrkunAcar <mustafaorkunacar@gmail.com>
> ---

This area below the "---" line under your sign-off is for commentary
which won't likely be relevant to someone looking at the patch in the
project history months or years from now. Everything you wrote above
about GSoC and only one instance of memcmp() belongs here.

The patch itself looks reasonable. As suggested by the microproject,
were you able to find any other places in the project which could
benefit likewise? If so, perhaps include a few of them when you
resubmit.

>  fetch-pack.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fetch-pack.c b/fetch-pack.c
> index f061f1f..17823ab 100644
> --- a/fetch-pack.c
> +++ b/fetch-pack.c
> @@ -506,7 +506,7 @@ static void filter_refs(struct fetch_pack_args *args,
>                 int keep = 0;
>                 next = ref->next;
>
> -               if (!memcmp(ref->name, "refs/", 5) &&
> +               if (starts_with(ref->name, "refs/") &&
>                     check_refname_format(ref->name, 0))
>                         ; /* trash */
>                 else {
> --
> 1.9.1.286.g5172cb3

      reply	other threads:[~2014-03-21  6:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-20 10:04 [PATCH] Rewritten fetch-pack.c:filter_refs() using starts_with() instead of memcmp() MustafaOrkunAcar
2014-03-21  6:27 ` Eric Sunshine [this message]

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=CAPig+cS+6Kg3S+mqLk_9dBdp96M_2L2fgyc1p29irrpmHuLNvA@mail.gmail.com \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=mustafaorkunacar@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).