I'm finding this short script useful, perhaps someone else will too.

Place this script, named "git-diffx" in your path:

#!/bin/bash

result=$(git diff $@)

if [ "$result" ]; then
   echo "$result" | gitx
fi

This lets you use the nice gitx diff viewer with the syntax "git diffx
--cached" and so on. I'm interested in getting gitx to release focus
when the diff window is closed, putting it back into Terminal. (MacVim
has a preference setting for this, workaround is to just quit gitx
instead of just closing the diff window.) If I have some spare time, I
might have a look at the source to see how easy that would be.

Douglas

Reply via email to