MCPcopy Index your code
hub / github.com/bradleyfalzon/revgrep

github.com/bradleyfalzon/revgrep @v0.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.3 ↗ · + Follow
16 symbols 38 edges 3 files 7 documented · 44% updated 2y ago★ 1034 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Overview

Build Status Coverage
Status GoDoc

revgrep is a CLI tool used to filter static analysis tools to only lines changed based on a commit reference.

Install

go get -u github.com/bradleyfalzon/revgrep/...

Usage

In the scenario below, a change was made causing a warning in go vet on line 5, but go vet will show all warnings. Using revgrep, you can show only warnings for lines of code that have been changed (in this case, hiding line 6).

[user@host dir (master)]$ go vet
main.go:5: missing argument for Sprintf("%s"): format reads arg 1, have only 0 args
main.go:6: missing argument for Sprintf("%s"): format reads arg 1, have only 0 args
[user@host dir (master)]$ go vet |& revgrep
main.go:5: missing argument for Sprintf("%s"): format reads arg 1, have only 0 args

|& is shown above as many static analysis programs write to stderr, not stdout, |& combines both stderr and stdout. It could also be achieved with go vet 2>&1 | revgrep.

revgrep CLI tool will return an exit status of 1 if any issues match, else it will return 0. Consider using ${PIPESTATUS[0]} for the exit status of the go vet command in the above example.

Usage: revgrep [options] [from-rev] [to-rev]

from-rev filters issues to lines changed since (and including) this revision
  to-rev filters issues to lines changed since (and including) this revision, requires <from-rev>

  If no revisions are given, and there are unstaged changes or untracked files, only those changes are shown
  If no revisions are given, and there are no unstaged changes or untracked files, only changes in HEAD~ are shown
  If from-rev is given and to-rev is not, only changes between from-rev and HEAD are shown.

    -d    Show debug output
      -regexp string
              Regexp to match path, line number, optional column number, and message

Other Examples

Issues between branches:

[user@host dir (feature/branch)]$ go vet |& revgrep master

Issues since last push:

[user@host dir (master)]$ go vet |& revgrep origin/master

Core symbols most depended-on inside this repo

debugf
called by 8
revgrep.go
Check
called by 3
revgrep.go
linesChanged
called by 2
revgrep.go
GitPatch
called by 2
revgrep.go
main
called by 0
cmd/revgrep/main.go

Shape

Function 9
Struct 4
Method 3

Languages

Go100%

Modules by API surface

revgrep.go8 symbols
revgrep_test.go7 symbols
cmd/revgrep/main.go1 symbols

For agents

$ claude mcp add revgrep \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page