From: root Date: Fri, 13 Oct 2017 14:24:25 +0000 (+0100) Subject: etc/profile.d/git.sh X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=ac9251519285a2db354070f871549f76e592f397;p=nb.git etc/profile.d/git.sh --- diff --git a/etc/profile.d/git.sh b/etc/profile.d/git.sh index 17a4db23..201181b4 100644 --- a/etc/profile.d/git.sh +++ b/etc/profile.d/git.sh @@ -169,22 +169,18 @@ git_conn_check() { return 0 } -# NB 26.09.17: TODO git_merge_from() { local usage="Usage: git_merge_from BRANCH, but does not push !" local from=${1:?$usage} local branch=$(git branch 2>/dev/null|awk '/^\*/{print $2}') [ -z "$branch" ] && echo "$usage" 1>&2 && return 1 - echo "git checkout $from && git pull && git checkout $branch && git merge $from" - return 0 + eval "git checkout $from && git pull && git checkout $branch && git merge $from" } -# NB 26.09.17: TODO git_merge_to() { local usage="Usage: git_merge_to BRANCH and auto push branch to !" local to=${1:?$usage} local branch=$(git branch 2>/dev/null|awk '/^\*/{print $2}') [ -z "$branch" ] && echo "$usage" 1>&2 && return 1 - echo "git checkout $to && git pull && git merge $branch && git push && git checkout $branch" - return 0 + eval "git checkout $to && git pull && git merge $branch && git push && git checkout $branch" }