Re: [GSoC][PATCH] grep: fix worktree case in submodules
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Jul 30, 2019, 22:02 UTC
- Message-ID
- <CAP8UFD0bH7ZNWFt3MfkAQf2tkF6CAgFj5FsZyc9zechg7MkCUw@mail.gmail.com>
- In-Reply-To
- <xmqqtvb3s2zi.fsf@gitster-ct.c.googlers.com>
On Tue, Jul 30, 2019 at 10:04 PM Junio C Hamano <gitster@pobox.com> wrote:
> > Matheus Tavares <matheus.bernardino@usp.br> writes:
Show 19 quoted lines
> > @@ -598,7 +599,8 @@ static int grep_tree(struct grep_opt *opt, const struct pathspec *pathspec,
> > free(data);
> > } else if (recurse_submodules && S_ISGITLINK(entry.mode)) {
> > hit |= grep_submodule(opt, pathspec, &entry.oid,
> > - base->buf, base->buf + tn_len);
> > + base->buf, base->buf + tn_len,
> > + 1); /* ignored */
>
> The trailing comment is misleading. In the context of reviewing
> this patch, we can probably tell it applies only to that "1", but
> if you read only the postimage, the "ignored" comment looks as if
> the call itself is somehow ignored by somebody unspecified. It is
> not clear at all that it is only about the final parameter.
>
> If you must...
>
> hit |= grep_submodule(opt, pathspec, &entry.oid,
> base->buf, base->buf + tn_len,
> 1 /* ignored */);Yeah, I suggested adding an "/* ignored */" comment, but I was indeed thinking about something like this.
> ... is a reasonable way to write it.