From 11171e55e5e1df97c03e0345116d0c719eb497ca Mon Sep 17 00:00:00 2001 From: Amber Date: Mon, 23 Nov 2020 15:27:10 +0100 Subject: [PATCH] gitopendiffs --- .bashrc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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