Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

167 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

marten

A terminal diff viewer for reviewing your work before it becomes a commit or pull request.

Marten demo

License Rust Built With Ratatui Release CI

HighlightsQuick StartInstallUsageConfiguration

Highlights

  • Review staged, unstaged, and untracked changes in one place
  • Compare commits, branches, tags, and Git revision ranges
  • Browse and search commit history without leaving the app
  • Switch between unified and side-by-side diffs
  • Find changed files and navigate between hunks quickly
  • Open a hunk directly in your editor
  • Use the mouse to select files and scroll through diffs
  • Exclude noisy files from your review with configurable ignore patterns

Quick Start

Install the latest release on macOS or Linux:

curl -fsSL https://raw.githubusercontent.com/jxdones/marten/main/install.sh | sh

Then run Marten inside a Git repository:

marten

Install

To install a specific release, pass its version:

curl -fsSL https://raw.githubusercontent.com/jxdones/marten/main/install.sh | sh -s -- v0.1.9

The installer supports Intel and ARM64 systems. Set BINDIR to install somewhere other than /usr/local/bin:

curl -fsSL https://raw.githubusercontent.com/jxdones/marten/main/install.sh | BINDIR="$HOME/.local/bin" sh

Using Cargo

Already have Rust 1.85 or newer? Install Marten directly from crates.io:

cargo install marten-diff --locked

The package is named marten-diff; once installed, launch it with marten. If you need a Rust toolchain, the recommended installer is rustup.

From source

To build from source, install Rust 1.85 or newer and run:

git clone https://github.com/jxdones/marten.git
cd marten
make install

Usage

Run it from inside a Git repository:

marten

Review the changes introduced by a commit, branch, tag, or other revision:

marten show HEAD~1

show accepts a commit, branch, tag, or other Git revision.

Compare two revisions directly:

marten diff main..feature-branch

Compare the second revision with the merge base of both revisions:

marten diff main...feature-branch

Configuration

Marten reads its configuration from ~/.config/marten/config.toml on macOS and Linux. The file is optional; when it is missing or empty, Marten uses its defaults.

[ui]
theme = "marten"
show_sidebar = true

[review]
ignore = ["*.lock", "generated/**", "vendor/"]

[diff]
ignore_whitespace = false

theme supports marten, ermine, catppuccin, dracula, and much more. When the setting is omitted, Marten uses marten by default. Choosing a theme from the in-app theme picker updates this setting.

show_sidebar controls whether the sidebar is visible at startup. When omitted, Marten shows it automatically when the terminal is wider than 120 columns. The sidebar can still be toggled while Marten is running.

ignore lists glob patterns for noisy files you'd rather not review (lockfiles, generated code, snapshots, vendored sources). When omitted, nothing is ignored.
Matching files are collapsed to their header and skipped by the diff loaders. They remain listed in the sidebar (marked ~) because they can still be visible as part of the changes.

  • Patterns without / match the basename at any depth (*.lock matches backend/Cargo.lock)
  • ** crosses directory boundaries (**/generated/** matches at any depth)
  • Trailing / matches everything beneath a directory (vendor/).

ignore_whitespace hides whitespace-only changes from diff hunks and statistics in working-tree, revision, and revision-range views. It defaults to false.
Files containing only whitespace changes remain listed because Git still considers them modified, but their diff is empty while this option is enabled.

Development

make run
make check
make test
make lint
make ci

Run make help for the complete list of targets.

To create a temporary repository with sample changes for UI work:

make dev-files
make clean-dev-files

License

MIT

About

A terminal diff viewer for reviewing your work before it becomes a commit or pull request.

Topics

Resources

Stars

11 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages