git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Christian Couder <christian.couder@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Matheus Tavares" <matheus.bernardino@usp.br>,
	git <git@vger.kernel.org>,
	"Olga Telezhnaya" <olyatelezhnaya@gmail.com>,
	kernel-usp@googlegroups.com, jackdanielz@eyomi.org,
	"Antonio Ospite" <ao2@ao2.it>,
	"Stefan Beller" <stefanbeller@gmail.com>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	"Jonathan Tan" <jonathantanmy@google.com>,
	"Brandon Williams" <bwilliams.eng@gmail.com>
Subject: Re: [GSoC][PATCH] grep: fix worktree case in submodules
Date: Wed, 31 Jul 2019 00:02:44 +0200	[thread overview]
Message-ID: <CAP8UFD0bH7ZNWFt3MfkAQf2tkF6CAgFj5FsZyc9zechg7MkCUw@mail.gmail.com> (raw)
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:

> > @@ -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.

  reply	other threads:[~2019-07-30 22:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-08  8:14 Weird behavior with git grep --recurse-submodules Daniel Zaoui
2019-07-10  6:43 ` Matheus Tavares Bernardino
2019-07-10 11:14   ` Johannes Schindelin
2019-07-16 18:10     ` Daniel Zaoui
2019-07-29 20:27       ` Matheus Tavares Bernardino
2019-07-30 16:53         ` [GSoC][PATCH] grep: fix worktree case in submodules Matheus Tavares
2019-07-30 20:04           ` Junio C Hamano
2019-07-30 22:02             ` Christian Couder [this message]
2019-07-31 15:57               ` Junio C Hamano
2019-08-01  3:08                 ` Matheus Tavares Bernardino
2019-07-30 23:40             ` Matheus Tavares Bernardino
2019-07-31 15:35           ` [GSoC][PATCH v2] " Matheus Tavares
2019-08-01  3:13             ` [GSoC][PATCH v3] " Matheus Tavares
2019-08-03 23:39         ` Weird behavior with git grep --recurse-submodules Brandon Williams

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=CAP8UFD0bH7ZNWFt3MfkAQf2tkF6CAgFj5FsZyc9zechg7MkCUw@mail.gmail.com \
    --to=christian.couder@gmail.com \
    --cc=ao2@ao2.it \
    --cc=bwilliams.eng@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jackdanielz@eyomi.org \
    --cc=jonathantanmy@google.com \
    --cc=kernel-usp@googlegroups.com \
    --cc=matheus.bernardino@usp.br \
    --cc=olyatelezhnaya@gmail.com \
    --cc=pclouds@gmail.com \
    --cc=stefanbeller@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).