Skip to content

Instantly share code, notes, and snippets.

@fluffy-critter
Created January 3, 2019 20:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fluffy-critter/bf3e7ff98518a850f5510db474664935 to your computer and use it in GitHub Desktop.
Save fluffy-critter/bf3e7ff98518a850f5510db474664935 to your computer and use it in GitHub Desktop.
simple git merge review tool

Simple code review tool thingy

  1. Put diff2html somewhere on your path
  2. Put this on your path too

Now you can quickly visualize a branch's code changes with e.g.

git cr

or

git cr branch-to-review master

or whatever.

This works on macOS. On Linux replace open with xdg-open and on Windows replace open with start.

#!/bin/sh
ref=${1:-HEAD}
base=${2:-master}
TEMPFILE=$(mktemp).html
git diff -w "$base"..."$ref" | diff2html.py -k > $TEMPFILE
open $TEMPFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment