public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Phillip Wood <phillip.wood123@gmail.com>
To: Markus Elfring <Markus.Elfring@web.de>, git@vger.kernel.org
Subject: Re: How to restrict command “git grep” to the first search result per file?
Date: Sun, 6 Jul 2025 14:27:11 +0100	[thread overview]
Message-ID: <83b8fd7c-622a-4041-a825-89fe743b6c97@gmail.com> (raw)
In-Reply-To: <fb74577d-f7b8-4fde-ab5a-5283e70b8258@web.de>

Hi Markus

On 06/07/2025 12:28, Markus Elfring wrote:
> File contents can be searched also by the means of the program call “git grep”.
> Would you become interested to find specified items only once in each file
> (instead of multiple times)?

Looking at the man page for git grep there is a --max-count option which 
will limit the number of matches per file.

Thanks

Phillip

      parent reply	other threads:[~2025-07-06 13:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-06 11:28 How to restrict command “git grep” to the first search result per file? Markus Elfring
2025-07-06 11:42 ` Andreas Schwab
2025-07-06 12:20   ` Markus Elfring
2025-07-08  5:30   ` Markus Elfring
2025-07-06 13:27 ` Phillip Wood [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=83b8fd7c-622a-4041-a825-89fe743b6c97@gmail.com \
    --to=phillip.wood123@gmail.com \
    --cc=Markus.Elfring@web.de \
    --cc=git@vger.kernel.org \
    --cc=phillip.wood@dunelm.org.uk \
    /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