Skip to content

AashrayAnand/git-goggles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-goggles 🥽

A CLI tool to browse functions and interfaces modified in git diffs. Features semantic diff analysis (added/modified/removed), filtering, and an interactive TUI mode. Output is clickable in VS Code terminal.

Installation

From crates.io

cargo install git-goggles

From source

cargo install --git https://github.com/aashrayanand/git-goggles

Manual

git clone https://github.com/aashrayanand/git-goggles
cd git-goggles
cargo install --path .

Usage

# Last commit
git-goggles HEAD~1

# Last 5 commits
git-goggles HEAD~5..HEAD

# Changes since main
git-goggles main..HEAD

# Staged changes
git-goggles --staged

# Interactive TUI mode
git-goggles -i HEAD~1

# Show grouped by change type
git-goggles --format grouped HEAD~1

# Show statistics
git-goggles --stats HEAD~1

# Filter by kind
git-goggles --kind functions HEAD~1
git-goggles --kind added HEAD~1

# Filter by file pattern
git-goggles --pattern "page_cache" HEAD~1

# JSON output for scripting
git-goggles --format json HEAD~1

# Specify repository path
git-goggles -C /path/to/repo HEAD~1

Example Output

Default Format

+ /path/to/project/src/page_cache.rs:940: fn find_page_at_or_above_lsn
~ /path/to/project/src/page_cache.rs:1524: fn get_page_for_dirty_writer
- /path/to/project/src/writer.rs:137: enum RangePayload
+ /path/to/project/src/writer.rs:1995: fn build_payload_for_request_range

Grouped Format (--format grouped)

━━━ Added ━━━
+ /path/to/project/src/page_cache.rs:940: fn find_page_at_or_above_lsn
+ /path/to/project/src/writer.rs:1995: fn build_payload_for_request_range

━━━ Modified ━━━
~ /path/to/project/src/page_cache.rs:1524: fn get_page_for_dirty_writer

━━━ Removed ━━━
- /path/to/project/src/writer.rs:137: enum RangePayload

Statistics (--stats)

━━━ Statistics ━━━
  +14 added | ~3 modified | -2 removed
  11 functions | 6 types | 5 files

Interactive TUI Mode (-i)

Press -i to launch the interactive terminal UI:

  • Navigation: j/k or arrow keys to move
  • Filter by change: a (added), m (modified), r (removed)
  • Filter by kind: f (functions), t (types)
  • Select: Enter to print the file path
  • Quit: q or Esc

Ctrl+click (or Cmd+click on Mac) on any line in VS Code terminal to jump directly to that function!

Supported Languages

  • Rust: fn, impl, struct, enum, trait
  • Python: def, class
  • Go: func
  • JavaScript/TypeScript: function

Aliases

Add to your shell config for convenience:

alias goggles="git-goggles"
alias gog="git-goggles"

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages