From: Jonathan Nieder <jrnieder@gmail•com>
To: "Matěj Cepl" <mcepl@cepl•eu>
Cc: Hongyi Zhao <hongyi.zhao@gmail•com>, Git List <git@vger•kernel.org>
Subject: Re: Change the grep command called by git with alternative tools, such as ug.
Date: Thu, 2 Jan 2025 16:28:23 +0100 [thread overview]
Message-ID: <Z3awl9gToJjwap-G@google.com> (raw)
In-Reply-To: <D6ROC4RAYQS1.3V2K2W5GMAEYR@cepl.eu>
Hi,
Matěj Cepl wrote:
> On Thu Jan 2, 2025 at 2:39 PM CET, Hongyi Zhao wrote:
>> Do you mean: by linking ug as git-ug will do the trick?
>
> No, you would have to rewrite git-grep to use external grep-like
> program. I am not sure whether there isn’t such project already
> out there.
The key question is - what are you trying to do? "git grep" is able
to search inside historical commits, the working copy, the index, and
so on. Do we want to search in the same way to find files with hits
(for efficiency reasons, for example) and then use an external program
to find the matches within those files? For that kind of application
I might do some scripting around "git grep --name-only", but I can
also imagine that your application is different. Depending on the
goal, it could be something a git command already supports, an implied
feature request for git, or something that the external search tool
might need to learn.
In other words, Matěj's reply is spot on in describing the current
behavior: "git grep" doesn't call out to an external grep tool. But
as for the desired behavior, we'd need to know more about the use case
to figure it out.
Thanks,
Jonathan
prev parent reply other threads:[~2025-01-02 15:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-02 11:48 Change the grep command called by git with alternative tools, such as ug Hongyi Zhao
2025-01-02 13:00 ` Matěj Cepl
2025-01-02 13:39 ` Hongyi Zhao
2025-01-02 14:57 ` Matěj Cepl
2025-01-02 15:28 ` Jonathan Nieder [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=Z3awl9gToJjwap-G@google.com \
--to=jrnieder@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=hongyi.zhao@gmail$(echo .)com \
--cc=mcepl@cepl$(echo .)eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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