From: karthik nayak <karthik.188@gmail.com>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: git@vger.kernel.org, christian.couder@gmail.com
Subject: Re: [PATCH 2/4] ref-filter: add ref-filter API
Date: Thu, 21 May 2015 22:52:59 +0530 [thread overview]
Message-ID: <555E1473.1010703@gmail.com> (raw)
In-Reply-To: <vpqr3qagvv6.fsf@anie.imag.fr>
On 05/21/2015 02:17 PM, Matthieu Moy wrote:
> Karthik Nayak <karthik.188@gmail.com> writes:
>
>> +static int match_name_as_path(const char **pattern, const char *refname)
>
> I would have appreciated a short docstring. The full doc would probably
> be as long as the code, but a few examples of what matches and what
> doesn't can help the reader.
>
Will patch with an explanation and some examples.
>> +static struct ref_filter_item *new_ref_filter_item(const char *refname,
>> + const unsigned char *sha1,
>> + int flag)
>> +{
>> + struct ref_filter_item *ref = xcalloc(1, sizeof(struct ref_filter_item));
>
> double-space after =.
Noted.
>
>> +++ b/ref-filter.h
>> @@ -0,0 +1,47 @@
>> +#ifndef REF_FILTER_H
>> +#define REF_FILTER_H
>> +
>> +#include "sha1-array.h"
>> +#include "refs.h"
>> +#include "commit.h"
>> +
>> +/*
>> + * ref-filter is meant to act as a common provider of API's for
>> + * 'tag -l', 'branch -l' and 'for-each-ref'. ref-filter is the attempt
>
> Don't be shy: attempt at unification -> unification. This message may be
> an attempt, but we'll polish it until it is more than that.
Haha, OK, will change that.
>
>> + * at unification of these three commands so that they ay benefit from
>
> they *may*?
Yes. Will change
>
>> + * the functionality of each other.
>> + */
>
> I miss a high-level description of what the code is doing. Essentially,
> there's the complete repository list of refs, and you want to filter
> only some of them, right?
>
> From the name, I would guess that ref_filter is the structure describing
> how you are filtering, but from the code it seems to be the list you're
> filtering, not the filter.
Will write a better explanation and description.
>
>> +/* An atom is a valid field atom used for sorting and formatting of refs.*/
>
> "used for" is very vague. Be more precise, say how it will be involved
> in sorting & formatting.
Noted.
>
>> +/* ref_filter will hold data pertaining to a list of refs. */
>
> This is the answer to the "what?" question, which is not very hard to
> infer from the code. That's not anwsering "what for?" or "why?", which
> are much harder to infer for the reader.
>
> (plus you have a double-space after /*)
>
Noted! Thanks for the suggestions :)
next prev parent reply other threads:[~2015-05-21 17:23 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-20 13:14 [WIP] [PATCH 0/4] Unifying git branch -l, git tag -l, and git for-each-ref karthik nayak
2015-05-20 13:18 ` [PATCH 1/4] for-each-ref: rename refinfo members to match similar structures Karthik Nayak
2015-05-20 16:57 ` Matthieu Moy
2015-05-21 6:27 ` karthik nayak
2015-05-20 13:18 ` [PATCH 2/4] ref-filter: add ref-filter API Karthik Nayak
2015-05-20 19:07 ` Eric Sunshine
2015-05-21 17:30 ` karthik nayak
2015-05-21 18:40 ` Eric Sunshine
2015-05-22 12:30 ` karthik nayak
2015-05-21 8:47 ` Matthieu Moy
2015-05-21 17:22 ` karthik nayak [this message]
2015-05-21 17:59 ` karthik nayak
2015-05-22 6:44 ` Matthieu Moy
2015-05-22 12:46 ` karthik nayak
2015-05-23 14:42 ` Matthieu Moy
2015-05-23 16:04 ` Christian Couder
2015-05-23 17:00 ` Matthieu Moy
2015-05-23 17:18 ` Junio C Hamano
2015-05-23 22:33 ` Matthieu Moy
2015-05-23 17:52 ` Karthik Nayak
2015-05-20 13:18 ` [PATCH 3/4] for-each-ref: convert to ref-filter Karthik Nayak
2015-05-20 23:50 ` Junio C Hamano
2015-05-21 6:51 ` karthik nayak
2015-05-20 13:18 ` [PATCH 4/4] ref-filter: move formatting/sorting options from 'for-each-ref' 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=555E1473.1010703@gmail.com \
--to=karthik.188@gmail.com \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.