Re: [PATCH v15 07/13] ref-filter: add support for %(contents:lines=X)
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Sep 2, 2015, 09:07 UTC
- Message-ID
- <vpq8u8ptcjq.fsf@anie.imag.fr>
- In-Reply-To
- <1441131994-13508-8-git-send-email-Karthik.188@gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 11 quoted lines
> --- a/builtin/tag.c > +++ b/builtin/tag.c > @@ -185,6 +185,10 @@ static enum contains_result contains(struct commit *candidate, > return contains_test(candidate, want); > } > > +/* > + * Currently modified and used in ref-filter as append_lines(), will > + * eventually be removed as we port tag.c to use ref-filter APIs. > + */ > static void show_tag_lines(const struct object_id *oid, int lines)
I would rather have one "cut and paste" patch followed by a "modify and use" patch for review.
As-is, reading the patch doesn't tell me what change you did.
That said, I did get this information in the interdiff, so I won't insist on that.
Show 8 quoted lines
> +static void append_lines(struct strbuf *out, const char *buf, unsigned long size, int lines)
> +{
> + int i;
> + const char *sp, *eol;
> + size_t len;
> +
> + if ((sp = strstr(buf, "\n\n")) && (sp <= buf + size))
> + size += 2;Why is this "size += 2" needed?
-- Matthieu Moy http://www-verimag.imag.fr/~moy/