Genivia / ugrep

NEW ugrep 6.5: a more powerful, ultra fast, user-friendly, compatible grep. Includes a TUI, Google-like Boolean search with AND/OR/NOT, fuzzy search, hexdumps, searches (nested) archives (zip, 7z, tar, pax, cpio), compressed files (gz, Z, bz2, lzma, xz, lz4, zstd, brotli), pdfs, docs, and more
https://ugrep.com
BSD 3-Clause "New" or "Revised" License
2.56k stars 109 forks source link

How to use ugrep instead of grep with git #357

Closed jcubic closed 6 months ago

jcubic commented 6 months ago

Is there a way to replace git grep with ugrep? I'm just testing this tool and most of the time I use grep with git command. If you know how I would add this to README.

I also asked on StackOverflow: Is there a way to replace grep in git with a different grep tool?

genivia-inc commented 6 months ago

I'm curious what made you ask? Do you have a specific use case in mind? Note that git grep is integrated into and managed by the git architecture. On the other hand, if you are recursively searching files in a local git repo on your file system then other grep will work just fine. With ug you want to specify --ignore-files to respect git exclusions. Make this automatic by adding ignore-files to your .ugrep config file. Also logical search queries (AND OR NOT) can be specified with ug, kind of like git grep, but a lot easier with option -% (logically match lines) and -%% (logically match files). See ug --help bool for details on this topic. Hope this helps.