1
0
mirror of https://gitlab.com/JKANetwork/jka-toolkit.git synced 2026-02-15 09:31:32 +01:00

Update gitdit

This commit is contained in:
JoseluCross
2016-06-28 16:34:38 +02:00
parent f68e6024a8
commit 178873b121

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
VERSION="0.1.3" 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)"` gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface" 0 0 6 p "Descargar actualizaciones del git (Hacer pull)" t "Confirmar cambios sin subida" s "Subir actualizaciones al git (Hacer push)" c "Descargar un nuevo git (Hacer clone)" n "Crear nueva rama" b "Cambiar de branch/rama (Hacer checkout)" m "Unir ramas (Hacer merge)"`
actual="origin $(git branch --list | grep "^*" | cut -f1 -d" ")" actual="origin $(git branch --list | grep "^*" | cut -f1 -d" ")"
case $gitopt in case $gitopt in
"p") git pull $actual;; "p") git pull $actual;;
@@ -14,6 +14,13 @@ case $gitopt in
giturl=`dialog --stdout --inputbox "URL del git" 10 60` giturl=`dialog --stdout --inputbox "URL del git" 10 60`
git clone $giturl git clone $giturl
;; ;;
"t")
commit=`dialog --stdout --inputbox "Cambios (texto commit)" 10 50 "changes"`
if [[ -z $commit ]];then
commit="changes"
fi
git add . && git commit -m "$commit"
;;
"b") "b")
j=0 j=0
rama="" rama=""
@@ -25,17 +32,32 @@ case $gitopt in
let j++ let j++
fi fi
done done
ramificacion=`dialog --stdout --scrollbar --menu "Selecione la rama" 0 0 6 $rama` ramificacion=`dialog --stdout --scrollbar --menu "Selecione la rama a saltar" 0 0 6 $rama`
if [ ! -z $ramificacion ];then
git checkout ${lista[$ramificacion]} git checkout ${lista[$ramificacion]}
fi
;;
"n")
NewBranch=`dialog --stdout --inputbox "Nombre de la nueva rama" 10 50 "new branch"`
if [ ! -z $NewBranch ];then
git checkout -b $NewBranch
fi
;; ;;
"m") "m")
until [[ $gitbusing && $gitbmerge ]] j=0
rama=""
for i in $(git branch --list | grep "^*" -v )
do do
gitbusing=`dialog --stdout --inputbox "Rama actual" 10 60` if [ $i != "*" ];then
gitbmerge=`dialog --stdout --inputbox "Rama con la que unir (la final,normalmente master)" 10 60 "master"` rama="$rama $j $i"
lista[$j]=$i
let j++
fi
done done
git checkout $gitbmerge merges=`dialog --stdout --scrollbar --menu "Selecione la rama a unir" 0 0 6 $rama`
git merge $gitbusing if [ ! -z $merges ];then
git merge ${lista[$merges]}
git push git push
fi
;; ;;
esac esac