Re: Change the grep command called by git with alternative tools, such as ug.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux