Skip to content

grepdiff: invert match #36

Description

@camsteffen

There should be a flag like -v, --invert-match in grep.

See https://stackoverflow.com/questions/57628550/grepdiff-find-hunks-that-dont-match-a-given-regexp (someone else's question).

My use case is to "unstage hunks that do not match" in git:

git diff --staged -U1 | grepdiff foo --invert-match --output-matching=hunk | git apply --cached -R

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions