Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libripgrep: PCRE2 support, multiline search, JSON output and more #1017

Merged
merged 4 commits into from
Aug 20, 2018

Commits on Aug 19, 2018

  1. libripgrep: initial commit introducing libripgrep

    libripgrep is not any one library, but rather, a collection of libraries
    that roughly separate the following key distinct phases in a grep
    implementation:
    
      1. Pattern matching (e.g., by a regex engine).
      2. Searching a file using a pattern matcher.
      3. Printing results.
    
    Ultimately, both (1) and (3) are defined by de-coupled interfaces, of
    which there may be multiple implementations. Namely, (1) is satisfied by
    the `Matcher` trait in the `grep-matcher` crate and (3) is satisfied by
    the `Sink` trait in the `grep2` crate. The searcher (2) ties everything
    together and finds results using a matcher and reports those results
    using a `Sink` implementation.
    
    Closes #162
    BurntSushi committed Aug 19, 2018
    Configuration menu
    Copy the full SHA
    70c92fd View commit details
    Browse the repository at this point in the history
  2. ripgrep: migrate to libripgrep

    This commit does the work to delete the old `grep` crate and effectively
    rewrite most of ripgrep core to use the new libripgrep crates. The new
    `grep` crate is now a facade that collects the various crates that make
    up libripgrep.
    
    The most complex part of ripgrep core is now arguably the translation
    between command line parameters and the library options, which is
    ultimately where we want to be.
    BurntSushi committed Aug 19, 2018
    Configuration menu
    Copy the full SHA
    9e79f8c View commit details
    Browse the repository at this point in the history
  3. tests: re-tool integration tests

    This basically rewrites every integration test. We reduce the amount of
    magic involved here in terms of which arguments are being passed to
    ripgrep processes. To make up for the boiler plate saved by the magic,
    we make the Dir (formerly WorkDir) type a bit nicer to use, along with a
    new TestCommand that wraps a std::process::Command. In exchange, we get
    tests that are easier to read and write.
    
    We also run every test with the `--pcre2` flag to make sure that works,
    when PCRE2 is available.
    BurntSushi committed Aug 19, 2018
    Configuration menu
    Copy the full SHA
    ab0c7a9 View commit details
    Browse the repository at this point in the history
  4. changelog: massive update for libripgrep

    This commit updates the CHANGELOG to reflect all the work done to make
    libripgrep a reality.
    
    * Closes #162 (libripgrep)
    * Closes #176 (multiline search)
    * Closes #188 (opt-in PCRE2 support)
    * Closes #244 (JSON output)
    * Closes #416 (Windows CRLF support)
    * Closes #917 (trim prefix whitespace)
    * Closes #993 (add --null-data flag)
    * Closes #997 (--passthru works with --replace)
    
    * Fixes #2 (memory maps and context handling work)
    * Fixes #200 (ripgrep stops when pipe is closed)
    * Fixes #389 (more intuitive `-w/--word-regexp`)
    * Fixes #643 (detection of stdin on Windows is better)
    * Fixes #441, Fixes #690, Fixes #980 (empty matching lines are weird)
    * Fixes #764 (coalesce color escapes)
    * Fixes #922 (memory maps failing is no big deal)
    * Fixes #937 (color escapes no longer used for empty matches)
    * Fixes #940 (--passthru does not impact exit status)
    * Fixes #1013 (show runtime CPU features in --version output)
    BurntSushi committed Aug 19, 2018
    Configuration menu
    Copy the full SHA
    52d7130 View commit details
    Browse the repository at this point in the history