Skip to content

Instantly share code, notes, and snippets.

@danro
Created August 12, 2011 01:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danro/1141221 to your computer and use it in GitHub Desktop.
Save danro/1141221 to your computer and use it in GitHub Desktop.
Configure git diff to use pretty MacVim splits
[diff]
external = ~/scripts/git-diff-wrapper.sh
#!/bin/sh
# diff is called by git with 7 parameters:
# path old-file old-hex old-mode new-file new-hex new-mode
mvim -d "$2" "$5" | cat
@migval
Copy link

migval commented Jan 19, 2013

When git try execute the script prompt this:

~/scripts/git-diff-wrapper.sh: /Users/miguel/scripts/git-diff-wrapper.sh: Permission denied
external diff died, stopping at .vimrc.

update------

Ok, it's necessary give execute permissions to .sh file:

chmod +x ~/scripts/git-diff-wrapper.sh

then works. Thanksss

@alesplin
Copy link

What version of git are you working on? For 1.8.1.2 (packaged with OS X) there's only 2 arguments passed, old-file and new-file.

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