Last active
August 29, 2015 14:02
-
-
Save CrashenX/bb823f26b653168154f8 to your computer and use it in GitHub Desktop.
Opens all files modified since specified revision of a git repo in vim and Gdiff them
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# You'll need to get vim-fugitive: | |
# https://github.com/tpope/vim-fugitive | |
if [ $# -eq 0 ] | |
then | |
since='HEAD^' | |
show_diff=false | |
else | |
since=$1 | |
show_diff=true | |
fi | |
git_cmd="git diff-tree --no-commit-id --name-only -r $since..HEAD" | |
gdiff="'+tabdo Gdiff $since' +tabfirst" | |
vim_cmd="vim -p `$git_cmd`" | |
if [ $show_diff == true ] | |
then | |
vim_cmd="$vim_cmd $gdiff" | |
fi | |
eval $vim_cmd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment