Giter VIP home page Giter VIP logo

hypergrep's Introduction

Highlights

  • Search recursively for a regex pattern using Intel Hyperscan.
  • When a git repository is detected, the repository index is searched using libgit2.
  • Similar to grep, ripgrep, ugrep, The Silver Searcher etc.
  • C++17, Multi-threading, SIMD.
  • USAGE GUIDE
  • Implementation notes here.
  • Not cross-platform. Tested in Linux.

Performance

The following tests compare the performance of hypergrep against:

System Details

Type Value
Processor 11th Gen Intel(R) Core(TM) i9-11900KF @ 3.50GHz 3.50 GHz
Instruction Set Extensions Intel® SSE4.1, Intel® SSE4.2, Intel® AVX2, Intel® AVX-512
Installed RAM 32.0 GB (31.9 GB usable)
SSD ADATA SX8200PNP
OS Ubuntu 20.04 LTS
C++ Compiler g++ (Ubuntu 11.1.0-1ubuntu1-20.04) 11.1.0

Vcpkg Installed Libraries

vcpkg commit: 662dbb5

Library Version
argparse 2.9
concurrentqueue 1.0.3
fmt 10.0.0
hyperscan 5.4.2
libgit2 1.6.4

Single Large File Search: OpenSubtitles.raw.en.txt

The following searches are performed on a single large file cached in memory (~13GB, OpenSubtitles.raw.en.gz).

Regex Line Count ag ugrep ripgrep hypergrep
Count number of times Holmes did something
hgrep -c 'Holmes did \w'
27 n/a 1.820 1.022 0.696
Literal with Regex Suffix
hgrep -nw 'Sherlock [A-Z]\w+' en.txt
7882 n/a 1.812 1.509 0.803
Simple Literal
hgrep -nw 'Sherlock Holmes' en.txt
7653 15.764 1.888 1.524 0.658
Simple Literal (case insensitive)
hgrep -inw 'Sherlock Holmes' en.txt
7871 15.599 6.945 2.162 0.650
Alternation of Literals
hgrep -n 'Sherlock Holmes|John Watson|Irene Adler|Inspector Lestrade|Professor Moriarty' en.txt
10078 n/a 6.886 1.836 0.689
Alternation of Literals (case insensitive)
hgrep -in 'Sherlock Holmes|John Watson|Irene Adler|Inspector Lestrade|Professor Moriarty' en.txt
10333 n/a 7.029 3.940 0.770
Words surrounding a literal string
hgrep -n '\w+[\x20]+Holmes[\x20]+\w+' en.txt
5020 n/a 6m 11s 1.523 0.638

Git Repository Search: torvalds/linux

The following searches are performed on the entire Linux kernel source tree (after running make defconfig && make -j8). The commit used is f1fcb.

Regex Line Count ag ugrep ripgrep hypergrep
Simple Literal
hgrep -nw 'PM_RESUME'
9 2.807 0.316 0.147 0.140
Simple Literal (case insensitive)
hgrep -niw 'PM_RESUME'
39 2.904 0.435 0.149 0.141
Regex with Literal Suffix
hgrep -nw '[A-Z]+_SUSPEND'
536 3.080 1.452 0.148 0.143
Alternation of four literals
hgrep -nw '(ERR_SYS|PME_TURN_OFF|LINK_REQ_RST|CFG_BME_EVT)'
16 3.085 0.410 0.153 0.146
Unicode Greek
hgrep -n '\p{Greek}'
111 3.762 0.484 0.345 0.146

Git Repository Search: apple/swift

The following searches are performed on the entire Apple Swift source tree. The commit used is 3865b.

Regex Line Count ag ugrep ripgrep hypergrep
Function/Struct/Enum declaration followed by a valid identifier and opening parenthesis
hgrep -n '(func|struct|enum)\s+[A-Za-z_][A-Za-z0-9_]*\s*\('
59026 1.148 0.954 0.154 0.090
Words starting with alphabetic characters followed by at least 2 digits
hgrep -nw '[A-Za-z]+\d{2,}'
127858 1.169 1.238 0.156 0.095
Workd starting with Uppercase letter, followed by alpha-numeric chars and/or underscores
hgrep -nw '[A-Z][a-zA-Z0-9_]*'
2012372 3.131 2.598 0.550 0.482
Guard let statement followed by valid identifier
hgrep -n 'guard\s+let\s+[a-zA-Z_][a-zA-Z0-9_]*\s*=\s*\w+'
839 0.828 0.174 0.054 0.047

Directory Search: /usr

The following searches are performed on the /usr directory.

Regex Line Count ag ugrep ripgrep hypergrep
Any HTTPS or FTP URL
hgrep "(https?|ftp)://[^\s/$.?#].[^\s]*"
13682 4.597 2.894 0.305 0.171
Any IPv4 IP address
hgrep -w "(?:\d{1,3}\.){3}\d{1,3}"
12643 4.727 2.340 0.324 0.166
Any E-mail address
hgrep -w "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}"
47509 5.477 37.209 0.494 0.220
Any valid date MM/DD/YYYY
hgrep "(0[1-9]|1[0-2])/(0[1-9]|[12]\d|3[01])/(19|20)\d{2}"
116 4.239 1.827 0.251 0.163
Count the number of HEX values
hgrep -cw "(?:0x)?[0-9A-Fa-f]+"
68042 5.765 28.691 1.439 0.611
Search any C/C++ for a literal
hgrep --filter "\.(c|cpp|h|hpp)$" test
7355 n/a 0.505 0.118 0.079

Build

Install Dependencies with vcpkg

git clone https://github.com/microsoft/vcpkg
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg install concurrentqueue fmt argparse libgit2 hyperscan

Build hypergrep using cmake and vcpkg

Clone the repository

git clone https://github.com/p-ranav/hypergrep
cd hypergrep

If cmake is older than 3.19

mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=<path_to_vcpkg>/scripts/buildsystems/vcpkg.cmake ..
make

If cmake is newer than 3.19

Use the release preset:

export VCPKG_ROOT=<path_to_vcpkg>
cmake -B build -S . --preset release
cmake --build build

Binary Portability

To build the binary for x86_64 portability, invoke cmake with -DBUILD_PORTABLE=on option. This will use -march=x86-64 -mtune=generic and -static-libgcc -static-libstdc++, and link the C++ standard library and GCC runtime statically into the binary, reducing dependencies on the target system.

hypergrep's People

Contributors

p-ranav avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hypergrep's Issues

Support `--include-zero`

        --include-zero                           
            When used with --count or --count-matches, print the number of matches for
            each file even if there were zero matches. This is disabled by default but can
            be enabled to make ripgrep behave more like grep.

Release Checklist

  • Documentation
    • USAGE_GIUDE.md elaborating on available features
  • Features
  • Tests
    • Update fmt dependency to v10.0
    • Line number is correct for small files with both stdout and pipe
    • Line number is correct for large files with both stdout and pipe
    • print_only_matching works correctly with both stdout and pipe
    • count works correctly with both stdout and pipe
    • symlinks are correctly ignored with both git repos and other directories
    • binary files are ignored using NULL byte detection and file extensions
    • Use HS_FLAG_SOM_LEFTMOST only if not print_matching_only and not stdout and not --columns

Use Dot All mode

“Dot all” mode
Tip
Use “dot all” mode where possible.

Not using the HS_FLAG_DOTALL pattern flag can be expensive, as implicitly, it means that patterns of the form /A.*B/ become /A[^\n]*B/.

It is likely that scanning tasks without the DOTALL flag are better done ‘line at a time’, with the newline sequences marking the beginning and end of each block.

This will be true in most use-cases (an exception being where the DOTALL flag is off but the pattern contains either explicit newlines or constructs such as \s that implicitly match a newline character).

Support -e,--regexp and -f,--file

-e, --regexp <PATTERN>...                    
        A pattern to search for. This option can be provided multiple times, where
        all patterns given are searched. Lines matching at least one of the provided
        patterns are printed. This flag can also be used when searching for patterns
        that start with a dash.
        
        For example, to search for the literal '-foo', you can use this flag:
        
            hg -e -foo

For print_only_filenames, use SINGLE_MATCH mode

Single-match flag
Tip
Consider using the single-match flag to limit matches to one match per pattern only if possible.

If only one match per pattern is required, use the flag provided to indicate this (HS_FLAG_SINGLEMATCH). This flag can allow a number of optimizations to be applied, allowing both performance improvements and state space reductions when streaming.

However, there is some overhead associated with tracking whether each pattern in the pattern set has matched, and some applications with infrequent matches may see reduced performance when the single-match flag is used.

Add support for `-b` byte offset

    -b, --byte-offset
            Print the 0-based byte offset within the input file before each line of output.
            If -o (--only-matching) is specified, print the offset of the matching part
            itself.

Validate File Search

Make sure that the final parts in the final chunk are searched (everything after the last newline) and not ignored.

Providing Byte-Offsets for Every Match

Feature Request
Description:

Hello,
I've noticed that if matches overlap, byte-offsets are only provided for the beginning of the matched part. As a result, the number of matches obtained with --count-matches flag is larger than the number of obtained byte-offsets with the -o -b flags. I suggest the addition of a new option or modification to existing options that allows users to obtain byte-offsets for every match, even when matches overlap.

Providing all byte-offsets for overlapping matches directly would streamline workflows which require byte-offsets for all matches.

Steps to Reproduce:

Text in a.txt: "012a34"
Pattern: "\p{N}{2}"
Use the regular expression to search for matches in a.txt:

hg -e "\p{N}{2}" -b -o a.txt

Result:

The number of matches obtained with the --count-matches flag is 3. It would be nice to be able to also obtain three byte-offsets (0,1 and 4 in this example).

Thank you for considering this feature request. I appreciate your work for enabling regex pattern searches with Hyperscan.

Notice: I edited this issue since I realized the matching mechanism is working with a sliding window.

updated benchmarks

Would it be possible to create benchmarks with the latest ripgrep?
because the version you used it like 4 years old and I'm quite sure that some things might have changed since then.

Update benchmark with ugrep 6.1 which is faster than hypergrep

Nice project!

I came across it because a ugrep user found a Reddit post about the project. Thanks for including ugrep in the benchmarks. It is always interesting how ugrep can be used in comparison. If there are some bottlenecks to speed, then I put it on the TODO list to resolve (see my note below).

The ugrep version used in these benchmark isn't up to date. More optimal search methods and optimizations were implemented in ugrep 3.12 and continued with 4.0. You may want to run the benchmarks with the latest ugrep e.g. v4.0.5. The old version 3.11 had an issue picking the wrong search algorithm in some cases, leading to a fall back to the default method that is slower.

Note that there are also plans for enhancing ugrep's search speed further with some tricks other grep use, as well as adding a new method to deal with pattern cases that ugrep doesn't yet handle well (long initial wildcard characters like .*foo that's not optimized at all but is easy to do by looking for foo), but these plans were (and some still are) delayed to give priority to new and improved features while ensuring reliability. I won't give a list of things that were added over time (since this is not about ugrep, but about hypergrep). Simply getting high performance with lots of new features is a tricky combination to do at the same time.

People always ask about new features or to improve them, they care a bit less about speed. Most often if they really want speed, then the its usually to search "cold" file systems. Then qgrep might be a good choice. Or perhaps ugrep-indexer.

I am curious, is hypergrep based on hyperscan? EDIT: sorry, dumb question, I see the answer in the README up front now. I wanted to ask, because hypergrep has a "simple grep" example that works OK, but not stellar.

Error in build scripts

As I wanted to compare hypergrep and ugrep, I'm trying to install hypergrep, but I'm having trouble building on MacOS 12.6.9 Monterey Intel x64 with the latest vcpkg version 2023-09-15 with all packages updated and after executing ./vcpkg install concurrentqueue fmt argparse libgit2 hyperscan.

The error message and build failure:
image

Wrong line number in 2 separate runs on the same directory

pranav@pop-os:/usr$ hg -nw test | hg /share/code/resources/app/out/vs/code/electron-main/main.js
36360:./share/code/resources/app/out/vs/code/electron-main/main.js:16:[Omitted long line with 6 matches]
36361:./share/code/resources/app/out/vs/code/electron-main/main.js:17:[Omitted long line with 8 matches]
36362:./share/code/resources/app/out/vs/code/electron-main/main.js:18:[Omitted long line with 9 matches]
36363:./share/code/resources/app/out/vs/code/electron-main/main.js:21:[Omitted long line with 9 matches]
36364:./share/code/resources/app/out/vs/code/electron-main/main.js:22:[Omitted long line with 9 matches]
36365:./share/code/resources/app/out/vs/code/electron-main/main.js:25:[Omitted long line with 9 matches]
36366:./share/code/resources/app/out/vs/code/electron-main/main.js:32:[Omitted long line with 15 matches]
36367:./share/code/resources/app/out/vs/code/electron-main/main.js:33:[Omitted long line with 15 matches]
36368:./share/code/resources/app/out/vs/code/electron-main/main.js:49:[Omitted long line with 15 matches]
36369:./share/code/resources/app/out/vs/code/electron-main/main.js:67:[Omitted long line with 3 matches]
36370:./share/code/resources/app/out/vs/code/electron-main/main.js:69:[Omitted long line with 3 matches]
36371:./share/code/resources/app/out/vs/code/electron-main/main.js:74:[Omitted long line with 2 matches]
36372:./share/code/resources/app/out/vs/code/electron-main/main.js:75:[Omitted long line with 1 matches]
pranav@pop-os:/usr$ hg -nw test | hg /share/code/resources/app/out/vs/code/electron-main/main.js
33795:./share/code/resources/app/out/vs/code/electron-main/main.js:2:[Omitted long line with 6 matches]
33796:./share/code/resources/app/out/vs/code/electron-main/main.js:2:[Omitted long line with 8 matches]
33797:./share/code/resources/app/out/vs/code/electron-main/main.js:3:[Omitted long line with 9 matches]
33798:./share/code/resources/app/out/vs/code/electron-main/main.js:5:[Omitted long line with 2 matches]
33799:./share/code/resources/app/out/vs/code/electron-main/main.js:6:[Omitted long line with 7 matches]
33800:./share/code/resources/app/out/vs/code/electron-main/main.js:9:[Omitted long line with 7 matches]
33801:./share/code/resources/app/out/vs/code/electron-main/main.js:10:[Omitted long line with 8 matches]
33802:./share/code/resources/app/out/vs/code/electron-main/main.js:11:[Omitted long line with 7 matches]
33803:./share/code/resources/app/out/vs/code/electron-main/main.js:27:[Omitted long line with 7 matches]
33804:./share/code/resources/app/out/vs/code/electron-main/main.js:28:[Omitted long line with 2 matches]
33805:./share/code/resources/app/out/vs/code/electron-main/main.js:29:[Omitted long line with 1 matches]
33806:./share/code/resources/app/out/vs/code/electron-main/main.js:29:[Omitted long line with 1 matches]
49767:./share/code/resources/app/out/vs/code/electron-main/main.js:16:[Omitted long line with 6 matches]
49768:./share/code/resources/app/out/vs/code/electron-main/main.js:17:[Omitted long line with 8 matches]
49769:./share/code/resources/app/out/vs/code/electron-main/main.js:18:[Omitted long line with 9 matches]
49770:./share/code/resources/app/out/vs/code/electron-main/main.js:21:[Omitted long line with 9 matches]
49771:./share/code/resources/app/out/vs/code/electron-main/main.js:22:[Omitted long line with 9 matches]
49772:./share/code/resources/app/out/vs/code/electron-main/main.js:25:[Omitted long line with 9 matches]
49773:./share/code/resources/app/out/vs/code/electron-main/main.js:32:[Omitted long line with 15 matches]
49774:./share/code/resources/app/out/vs/code/electron-main/main.js:33:[Omitted long line with 15 matches]
49775:./share/code/resources/app/out/vs/code/electron-main/main.js:49:[Omitted long line with 15 matches]
49776:./share/code/resources/app/out/vs/code/electron-main/main.js:67:[Omitted long line with 3 matches]
49777:./share/code/resources/app/out/vs/code/electron-main/main.js:69:[Omitted long line with 3 matches]
49778:./share/code/resources/app/out/vs/code/electron-main/main.js:74:[Omitted long line with 2 matches]
49779:./share/code/resources/app/out/vs/code/electron-main/main.js:75:[Omitted long line with 1 matches]
pranav@pop-os:/usr$ hg -nw test | hg /share/code/resources/app/out/vs/code/electron-main/main.js
105024:./share/code/resources/app/out/vs/code/electron-main/main.js:16:[Omitted long line with 6 matches]
105025:./share/code/resources/app/out/vs/code/electron-main/main.js:17:[Omitted long line with 8 matches]
105026:./share/code/resources/app/out/vs/code/electron-main/main.js:18:[Omitted long line with 9 matches]
105027:./share/code/resources/app/out/vs/code/electron-main/main.js:21:[Omitted long line with 9 matches]
105028:./share/code/resources/app/out/vs/code/electron-main/main.js:22:[Omitted long line with 9 matches]
105029:./share/code/resources/app/out/vs/code/electron-main/main.js:25:[Omitted long line with 9 matches]
105030:./share/code/resources/app/out/vs/code/electron-main/main.js:32:[Omitted long line with 15 matches]
105031:./share/code/resources/app/out/vs/code/electron-main/main.js:33:[Omitted long line with 15 matches]
105032:./share/code/resources/app/out/vs/code/electron-main/main.js:49:[Omitted long line with 15 matches]
105033:./share/code/resources/app/out/vs/code/electron-main/main.js:67:[Omitted long line with 3 matches]
105034:./share/code/resources/app/out/vs/code/electron-main/main.js:69:[Omitted long line with 3 matches]
105035:./share/code/resources/app/out/vs/code/electron-main/main.js:74:[Omitted long line with 2 matches]
105036:./share/code/resources/app/out/vs/code/electron-main/main.js:75:[Omitted long line with 1 matches]
pranav@pop-os:/usr$ hg -nw test | hg /share/code/resources/app/out/vs/code/electron-main/main.js
105021:./share/code/resources/app/out/vs/code/electron-main/main.js:16:[Omitted long line with 6 matches]
105022:./share/code/resources/app/out/vs/code/electron-main/main.js:17:[Omitted long line with 8 matches]
105023:./share/code/resources/app/out/vs/code/electron-main/main.js:18:[Omitted long line with 9 matches]
105024:./share/code/resources/app/out/vs/code/electron-main/main.js:21:[Omitted long line with 9 matches]
105025:./share/code/resources/app/out/vs/code/electron-main/main.js:22:[Omitted long line with 9 matches]
105026:./share/code/resources/app/out/vs/code/electron-main/main.js:25:[Omitted long line with 9 matches]
105027:./share/code/resources/app/out/vs/code/electron-main/main.js:32:[Omitted long line with 15 matches]
105028:./share/code/resources/app/out/vs/code/electron-main/main.js:33:[Omitted long line with 15 matches]
105029:./share/code/resources/app/out/vs/code/electron-main/main.js:49:[Omitted long line with 15 matches]
105030:./share/code/resources/app/out/vs/code/electron-main/main.js:67:[Omitted long line with 3 matches]
105031:./share/code/resources/app/out/vs/code/electron-main/main.js:69:[Omitted long line with 3 matches]
105032:./share/code/resources/app/out/vs/code/electron-main/main.js:74:[Omitted long line with 2 matches]
105033:./share/code/resources/app/out/vs/code/electron-main/main.js:75:[Omitted long line with 1 matches]
pranav@pop-os:/usr$ hg -nw test | hg /share/code/resources/app/out/vs/code/electron-main/main.js
64725:./share/code/resources/app/out/vs/code/electron-main/main.js:16:[Omitted long line with 6 matches]
64726:./share/code/resources/app/out/vs/code/electron-main/main.js:17:[Omitted long line with 8 matches]
64727:./share/code/resources/app/out/vs/code/electron-main/main.js:18:[Omitted long line with 9 matches]
64728:./share/code/resources/app/out/vs/code/electron-main/main.js:21:[Omitted long line with 9 matches]
64729:./share/code/resources/app/out/vs/code/electron-main/main.js:22:[Omitted long line with 9 matches]
64730:./share/code/resources/app/out/vs/code/electron-main/main.js:25:[Omitted long line with 9 matches]
64731:./share/code/resources/app/out/vs/code/electron-main/main.js:32:[Omitted long line with 15 matches]
64732:./share/code/resources/app/out/vs/code/electron-main/main.js:33:[Omitted long line with 15 matches]
64733:./share/code/resources/app/out/vs/code/electron-main/main.js:49:[Omitted long line with 15 matches]
64734:./share/code/resources/app/out/vs/code/electron-main/main.js:67:[Omitted long line with 3 matches]
64735:./share/code/resources/app/out/vs/code/electron-main/main.js:69:[Omitted long line with 3 matches]
64736:./share/code/resources/app/out/vs/code/electron-main/main.js:74:[Omitted long line with 2 matches]
64737:./share/code/resources/app/out/vs/code/electron-main/main.js:75:[Omitted long line with 1 matches]
pranav@pop-os:/usr$ hg -nw test | hg /share/code/resources/app/out/vs/code/electron-main/main.js
16862:./share/code/resources/app/out/vs/code/electron-main/main.js:2:[Omitted long line with 6 matches]
16863:./share/code/resources/app/out/vs/code/electron-main/main.js:2:[Omitted long line with 8 matches]
16864:./share/code/resources/app/out/vs/code/electron-main/main.js:3:[Omitted long line with 9 matches]
16865:./share/code/resources/app/out/vs/code/electron-main/main.js:5:[Omitted long line with 2 matches]
16866:./share/code/resources/app/out/vs/code/electron-main/main.js:6:[Omitted long line with 7 matches]
16867:./share/code/resources/app/out/vs/code/electron-main/main.js:9:[Omitted long line with 7 matches]
16868:./share/code/resources/app/out/vs/code/electron-main/main.js:10:[Omitted long line with 8 matches]
16869:./share/code/resources/app/out/vs/code/electron-main/main.js:11:[Omitted long line with 7 matches]
16870:./share/code/resources/app/out/vs/code/electron-main/main.js:27:[Omitted long line with 7 matches]
16871:./share/code/resources/app/out/vs/code/electron-main/main.js:28:[Omitted long line with 2 matches]
16872:./share/code/resources/app/out/vs/code/electron-main/main.js:29:[Omitted long line with 1 matches]
16873:./share/code/resources/app/out/vs/code/electron-main/main.js:29:[Omitted long line with 1 matches]
^[[A78172:./share/code/resources/app/out/vs/code/electron-main/main.js:16:[Omitted long line with 6 matches]
78173:./share/code/resources/app/out/vs/code/electron-main/main.js:17:[Omitted long line with 8 matches]
78174:./share/code/resources/app/out/vs/code/electron-main/main.js:18:[Omitted long line with 9 matches]
78175:./share/code/resources/app/out/vs/code/electron-main/main.js:21:[Omitted long line with 9 matches]
78176:./share/code/resources/app/out/vs/code/electron-main/main.js:22:[Omitted long line with 9 matches]
78177:./share/code/resources/app/out/vs/code/electron-main/main.js:25:[Omitted long line with 9 matches]
78178:./share/code/resources/app/out/vs/code/electron-main/main.js:32:[Omitted long line with 15 matches]
78179:./share/code/resources/app/out/vs/code/electron-main/main.js:33:[Omitted long line with 15 matches]
78180:./share/code/resources/app/out/vs/code/electron-main/main.js:49:[Omitted long line with 15 matches]
78181:./share/code/resources/app/out/vs/code/electron-main/main.js:67:[Omitted long line with 3 matches]
78182:./share/code/resources/app/out/vs/code/electron-main/main.js:69:[Omitted long line with 3 matches]
78183:./share/code/resources/app/out/vs/code/electron-main/main.js:74:[Omitted long line with 2 matches]
78184:./share/code/resources/app/out/vs/code/electron-main/main.js:75:[Omitted long line with 1 matches]
pranav@pop-os:/usr$ hg -nw test | hg /share/code/resources/app/out/vs/code/electron-main/main.js
63165:./share/code/resources/app/out/vs/code/electron-main/main.js:16:[Omitted long line with 6 matches]
63166:./share/code/resources/app/out/vs/code/electron-main/main.js:17:[Omitted long line with 8 matches]
63167:./share/code/resources/app/out/vs/code/electron-main/main.js:18:[Omitted long line with 9 matches]
63168:./share/code/resources/app/out/vs/code/electron-main/main.js:21:[Omitted long line with 9 matches]
63169:./share/code/resources/app/out/vs/code/electron-main/main.js:22:[Omitted long line with 9 matches]
63170:./share/code/resources/app/out/vs/code/electron-main/main.js:25:[Omitted long line with 9 matches]
63171:./share/code/resources/app/out/vs/code/electron-main/main.js:32:[Omitted long line with 15 matches]
63172:./share/code/resources/app/out/vs/code/electron-main/main.js:33:[Omitted long line with 15 matches]
63173:./share/code/resources/app/out/vs/code/electron-main/main.js:49:[Omitted long line with 15 matches]
63174:./share/code/resources/app/out/vs/code/electron-main/main.js:67:[Omitted long line with 3 matches]
63175:./share/code/resources/app/out/vs/code/electron-main/main.js:69:[Omitted long line with 3 matches]
63176:./share/code/resources/app/out/vs/code/electron-main/main.js:74:[Omitted long line with 2 matches]
63177:./share/code/resources/app/out/vs/code/electron-main/main.js:75:[Omitted long line with 1 matches]

Support --max-depth

    --max-depth <NUM>                        
        Limit the depth of directory traversal to NUM levels beyond the paths given. A
        value of zero only searches the explicitly given paths themselves.
        
        For example, 'rg --max-depth 0 dir/' is a no-op because dir/ will not be
        descended into. 'rg --max-depth 1 dir/' will search only the direct children of
        'dir'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.