diff --git a/.bashrc b/.bashrc index 666477c..a705139 100644 --- a/.bashrc +++ b/.bashrc @@ -231,7 +231,20 @@ gitdelbranch() { } gitopendiffs() { - vim -p `git diff --name-only origin/master | sed 's/src\///g'` + myhelp() { + echo 'This tool is usefull to open in vim the diff with a branch and a branch in origin' + echo 'Before to launch place in the repository' + } + if [ "$1" == '-h' ]; then + myhelp + return 1 + fi + if [ $1 == '']; then + branch='master' + else + branch=$1 + fi + vim -p `git diff --name-only 'origin/'$branch | sed 's/src\///g'` } export PATH=~/bin/:$PATH