From bde0e639df905a1853319325af0d75d74cd6bf4d Mon Sep 17 00:00:00 2001 From: JoseluCross Date: Tue, 28 Jun 2016 15:33:53 +0200 Subject: [PATCH] Mejora gitdit --- jka-toolkit/gitdit | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/jka-toolkit/gitdit b/jka-toolkit/gitdit index c233dec..0e895c5 100755 --- a/jka-toolkit/gitdit +++ b/jka-toolkit/gitdit @@ -1,9 +1,10 @@ #!/bin/bash VERSION="0.1.3" gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface" 0 0 6 p "Descargar actualizaciones del git (Hacer pull)" s "Subir actualizaciones al git (Hacer push)" c "Descargar un nuevo git (Hacer clone)" b "Cambiar de branch/rama (Hacer checkout)" m "Unir ramas (Hacer merge)"` - +alias brunch='git branch --list' +actual="origin $(brunch | grep "^*" | cut -f1 -d" ")" case $gitopt in - "p") git pull;; + "p") git pull $actual;; "s") commit=`dialog --stdout --inputbox "Cambios (texto commit)" 10 50 "changes"` if [[ -z $commit ]];then commit="changes" @@ -15,9 +16,18 @@ case $gitopt in git clone $giturl ;; "b") - gitbranch=`dialog --stdout --inputbox "Nueva rama/branch" 10 60` - git checkout $gitbranch - ;; + j=0 + rama="" + for i in $(brunch) + do + if [ $i != "*" ] + rama="$rama $j $i" + lista[$j]=$i + let j++ + fi + done + ramificacion=`dialog --stdout --scrollbar --menu "Selecione la rama" 0 0 6 $rama` + git checkout ${lista[$ramificacion]} "m") until [[ $gitbusing && $gitbmerge ]] do