From 9b8508c04e2ff084f0d5f0e0942a55383a447319 Mon Sep 17 00:00:00 2001 From: JoseluCross Date: Wed, 29 Jun 2016 16:07:07 +0200 Subject: [PATCH 1/7] Update --- jka-toolkit/gitdit | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/jka-toolkit/gitdit b/jka-toolkit/gitdit index 2d91bdc..4628aaa 100755 --- a/jka-toolkit/gitdit +++ b/jka-toolkit/gitdit @@ -1,7 +1,12 @@ #!/bin/bash -VERSION="0.2.0" -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 -f2 -d" ")" +VERSION="0.2.1" +preOption=$(git status 2>/dev/stdout | sed -n 1p | cut -f2 -d" ") +if [ $preOption = "Not" ];then + gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface" 0 0 6 c "Descargar un nuevo git (Hacer clone)"` +else + 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)" n "Crear nueva rama" b "Cambiar de branch/rama (Hacer checkout)" m "Unir ramas (Hacer merge)"` + actual="origin $(git branch --list | grep "^*" | cut -f2 -d" ")" +fi case $gitopt in "p") git pull $actual;; "s") commit=`dialog --stdout --inputbox "Cambios (texto commit)" 10 50 "changes"` From 3cbeaed665be5adde0f3913854c7e9315e0887be Mon Sep 17 00:00:00 2001 From: JoseluCross Date: Wed, 29 Jun 2016 16:08:23 +0200 Subject: [PATCH 2/7] up --- jka-toolkit/gitdit | 8 +++++++- jka-toolkit/pruebas | 3 --- 2 files changed, 7 insertions(+), 4 deletions(-) delete mode 100644 jka-toolkit/pruebas diff --git a/jka-toolkit/gitdit b/jka-toolkit/gitdit index 4628aaa..ee1f3f2 100755 --- a/jka-toolkit/gitdit +++ b/jka-toolkit/gitdit @@ -1,4 +1,5 @@ #!/bin/bash +<<<<<<< HEAD VERSION="0.2.1" preOption=$(git status 2>/dev/stdout | sed -n 1p | cut -f2 -d" ") if [ $preOption = "Not" ];then @@ -7,6 +8,11 @@ else 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)" n "Crear nueva rama" b "Cambiar de branch/rama (Hacer checkout)" m "Unir ramas (Hacer merge)"` actual="origin $(git branch --list | grep "^*" | cut -f2 -d" ")" fi +======= +VERSION="0.2.0" +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 a la rama actual)"` +actual="origin $(git branch --list | grep "^*" | cut -f2 -d" ")" +>>>>>>> 2da0286157275673f471fb4fedc9f166b1926275 case $gitopt in "p") git pull $actual;; "s") commit=`dialog --stdout --inputbox "Cambios (texto commit)" 10 50 "changes"` @@ -59,7 +65,7 @@ case $gitopt in let j++ fi done - merges=`dialog --stdout --scrollbar --menu "Selecione la rama a unir" 0 0 6 $rama` + merges=`dialog --stdout --scrollbar --menu "Selecione la rama a unir a $(git branch --list | grep "^*" | cut -f2 -d" ")" 0 0 6 $rama` if [ ! -z $merges ];then git merge ${lista[$merges]} git push diff --git a/jka-toolkit/pruebas b/jka-toolkit/pruebas deleted file mode 100644 index 8b63174..0000000 --- a/jka-toolkit/pruebas +++ /dev/null @@ -1,3 +0,0 @@ -* hotfix - master - pruebas From 387cfc847af84a3a225c40a30534df7f1833b4fb Mon Sep 17 00:00:00 2001 From: JoseluCross Date: Wed, 29 Jun 2016 16:10:10 +0200 Subject: [PATCH 3/7] Update gitdit --- jka-toolkit/gitdit | 6 ------ 1 file changed, 6 deletions(-) diff --git a/jka-toolkit/gitdit b/jka-toolkit/gitdit index ee1f3f2..b2d7975 100755 --- a/jka-toolkit/gitdit +++ b/jka-toolkit/gitdit @@ -1,5 +1,4 @@ #!/bin/bash -<<<<<<< HEAD VERSION="0.2.1" preOption=$(git status 2>/dev/stdout | sed -n 1p | cut -f2 -d" ") if [ $preOption = "Not" ];then @@ -8,11 +7,6 @@ else 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)" n "Crear nueva rama" b "Cambiar de branch/rama (Hacer checkout)" m "Unir ramas (Hacer merge)"` actual="origin $(git branch --list | grep "^*" | cut -f2 -d" ")" fi -======= -VERSION="0.2.0" -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 a la rama actual)"` -actual="origin $(git branch --list | grep "^*" | cut -f2 -d" ")" ->>>>>>> 2da0286157275673f471fb4fedc9f166b1926275 case $gitopt in "p") git pull $actual;; "s") commit=`dialog --stdout --inputbox "Cambios (texto commit)" 10 50 "changes"` From b51f5bd9ba48d4cca896d34f7fe89c1812544f82 Mon Sep 17 00:00:00 2001 From: JoseluCross Date: Wed, 29 Jun 2016 16:12:27 +0200 Subject: [PATCH 4/7] update --- jka-toolkit/jkazip | 1 + 1 file changed, 1 insertion(+) diff --git a/jka-toolkit/jkazip b/jka-toolkit/jkazip index 92b5a23..aac6f12 100755 --- a/jka-toolkit/jkazip +++ b/jka-toolkit/jkazip @@ -1,4 +1,5 @@ #!/bin/bash + #JKA - ZIP #A script for de/compress files and folders in many formats #Author: JKA Network - contacto@jkanetwork.com From 4534dd214cfb906eedfe6a3575a65d9c51f485a8 Mon Sep 17 00:00:00 2001 From: JoseluCross Date: Wed, 29 Jun 2016 16:27:34 +0200 Subject: [PATCH 5/7] Error control improved, add comments and headers, null option included (cancel button) --- jka-toolkit/gitdit | 141 +++++++++++++++++++++++++-------------------- 1 file changed, 79 insertions(+), 62 deletions(-) diff --git a/jka-toolkit/gitdit b/jka-toolkit/gitdit index b2d7975..5a4c54a 100755 --- a/jka-toolkit/gitdit +++ b/jka-toolkit/gitdit @@ -1,68 +1,85 @@ #!/bin/bash -VERSION="0.2.1" +# gitdit, a dialog interface to manage git repositories +# Author: JKA Network - contacto@jkanetwork.com + +VERSION="0.2.2" +#First check if the user is in a git repository preOption=$(git status 2>/dev/stdout | sed -n 1p | cut -f2 -d" ") -if [ $preOption = "Not" ];then +if [ $preOption = "Not" ];then #When it isn't only it can do git clone gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface" 0 0 6 c "Descargar un nuevo git (Hacer clone)"` -else +else #Else, all other options 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)" n "Crear nueva rama" b "Cambiar de branch/rama (Hacer checkout)" m "Unir ramas (Hacer merge)"` - actual="origin $(git branch --list | grep "^*" | cut -f2 -d" ")" + actual="origin $(git branch --list | grep "^*" | cut -f2 -d" ")" #Current branch fi -case $gitopt in - "p") git pull $actual;; - "s") commit=`dialog --stdout --inputbox "Cambios (texto commit)" 10 50 "changes"` - if [[ -z $commit ]];then - commit="changes" - fi - git add . && git commit -m "$commit" && git push $actual - ;; - "c") - giturl=`dialog --stdout --inputbox "URL del git" 10 60` - 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") - j=0 - rama="" - for i in $(git branch --list | grep "^*" -v ) - do - if [ $i != "*" ];then - rama="$rama $j $i" - lista[$j]=$i - let j++ +if [ ! -z $gitopt ];then #No canceled + case $gitopt in + "p") + git pull $actual;; + "s") + estado=$(git status | wc -l) #It need to commit something? + if [ $estado -ne 2 ];then #When is necesary commit + commit=`dialog --stdout --inputbox "Cambios (texto commit)" 10 50 "changes"` + if [[ -z $commit ]];then + commit="changes" + fi + git add . && git commit -m "$commit" && git push $actual + else #Nothing to commit, only push + git push $actual + fi + ;; + "c") + giturl=`dialog --stdout --inputbox "URL del git" 10 60` + if [ -z $giturl ];then + echo "NingĂșn repositorio especificado" + exit + fi + 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") + j=0 + rama="" + for i in $(git branch --list | grep "^*" -v ) + do + if [ $i != "*" ];then + rama="$rama $j $i" + lista[$j]=$i + let j++ + fi + done + ramificacion=`dialog --stdout --scrollbar --menu "Selecione la rama a saltar" 0 0 6 $rama` + if [ ! -z $ramificacion ];then + 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") + j=0 + rama="" + for i in $(git branch --list | grep "^*" -v ) + do + if [ $i != "*" ];then + rama="$rama $j $i" + lista[$j]=$i + let j++ + fi + done + merges=`dialog --stdout --scrollbar --menu "Selecione la rama a unir a $(git branch --list | grep "^*" | cut -f2 -d" ")" 0 0 6 $rama` + if [ ! -z $merges ];then + git merge ${lista[$merges]} + git push fi - done - ramificacion=`dialog --stdout --scrollbar --menu "Selecione la rama a saltar" 0 0 6 $rama` - if [ ! -z $ramificacion ];then - 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") - j=0 - rama="" - for i in $(git branch --list | grep "^*" -v ) - do - if [ $i != "*" ];then - rama="$rama $j $i" - lista[$j]=$i - let j++ - fi - done - merges=`dialog --stdout --scrollbar --menu "Selecione la rama a unir a $(git branch --list | grep "^*" | cut -f2 -d" ")" 0 0 6 $rama` - if [ ! -z $merges ];then - git merge ${lista[$merges]} - git push - fi - ;; -esac + ;; + esac +fi \ No newline at end of file From 6d1ffe8fa28032b5ab16d756ff4992010ec030b6 Mon Sep 17 00:00:00 2001 From: JoseluCross Date: Wed, 29 Jun 2016 19:43:53 +0200 Subject: [PATCH 6/7] modified jkazip to test, md5sum same before --- README.md | 6 +++--- jka-toolkit/jkazip | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2196b15..6cb09c2 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,11 @@ GENERAL USAGE NOTES -------------------- * JKA Toolkit is a set of script to make easiest of Linux terminal * Now this kit include: - * apw - a package wrapper - Version 1.8 + * apw - a package wrapper - Version 1.9 * A wrapper to manage package managers of the differents Linux distributions, compatible with the families of *Debian, Archlinux, RedHat, CentOS, OpenSuse* and *Void Linux* - * jkazip - Version 2.0.2 + * jkazip - Version 2.0.3 * A script which use the differents zip and unzip programs, support *tar, lzip, lzma (xz), zip, 7zip, gzip, bzip2* and *rar* (only for unzip) - * gitdit - GIT DIalog inTerface Version 0.1 + * gitdit - GIT DIalog inTerface Version 0.2.2 * A dialog interface to manage git repositories with *pull, add-commit-push, clone, checkout,* and *merge* Contact diff --git a/jka-toolkit/jkazip b/jka-toolkit/jkazip index aac6f12..92b5a23 100755 --- a/jka-toolkit/jkazip +++ b/jka-toolkit/jkazip @@ -1,5 +1,4 @@ #!/bin/bash - #JKA - ZIP #A script for de/compress files and folders in many formats #Author: JKA Network - contacto@jkanetwork.com From 3b62d77253ab33f550c39b0ac1c37598612f810d Mon Sep 17 00:00:00 2001 From: JoseluCross Date: Wed, 29 Jun 2016 19:51:54 +0200 Subject: [PATCH 7/7] Improved update option and include init option --- jka-toolkit/gitdit | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/jka-toolkit/gitdit b/jka-toolkit/gitdit index 5a4c54a..1b80a97 100755 --- a/jka-toolkit/gitdit +++ b/jka-toolkit/gitdit @@ -2,30 +2,20 @@ # gitdit, a dialog interface to manage git repositories # Author: JKA Network - contacto@jkanetwork.com -VERSION="0.2.2" +VERSION="0.2.3" #First check if the user is in a git repository preOption=$(git status 2>/dev/stdout | sed -n 1p | cut -f2 -d" ") if [ $preOption = "Not" ];then #When it isn't only it can do git clone - gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface" 0 0 6 c "Descargar un nuevo git (Hacer clone)"` + gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface" 0 0 6 c "Descargar un nuevo repo (Hacer clone)"" i "Inicializar nuevo repo"` else #Else, all other options 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)" n "Crear nueva rama" b "Cambiar de branch/rama (Hacer checkout)" m "Unir ramas (Hacer merge)"` actual="origin $(git branch --list | grep "^*" | cut -f2 -d" ")" #Current branch fi if [ ! -z $gitopt ];then #No canceled case $gitopt in - "p") - git pull $actual;; - "s") - estado=$(git status | wc -l) #It need to commit something? - if [ $estado -ne 2 ];then #When is necesary commit - commit=`dialog --stdout --inputbox "Cambios (texto commit)" 10 50 "changes"` - if [[ -z $commit ]];then - commit="changes" - fi - git add . && git commit -m "$commit" && git push $actual - else #Nothing to commit, only push - git push $actual - fi + #Not staying in a git repo + "i") + git init ;; "c") giturl=`dialog --stdout --inputbox "URL del git" 10 60` @@ -35,6 +25,21 @@ if [ ! -z $gitopt ];then #No canceled fi git clone $giturl ;; + #Staying in a git repo + "p") + git pull $actual;; + "s") + estado=$(git status | grep "^Changes" ) #It need to commit something? + if [ $estado ];then #When is necesary commit + commit=`dialog --stdout --inputbox "Cambios (texto commit)" 10 50 "changes"` + if [[ -z $commit ]];then + commit="changes" + fi + git add . && git commit -m "$commit" && git push $actual + else #Nothing to commit, only push + git push $actual + fi + ;; "t") commit=`dialog --stdout --inputbox "Cambios (texto commit)" 10 50 "changes"` if [[ -z $commit ]];then @@ -45,11 +50,12 @@ if [ ! -z $gitopt ];then #No canceled "b") j=0 rama="" + #Loop to create dialog whith all branches (except the current) for i in $(git branch --list | grep "^*" -v ) do if [ $i != "*" ];then rama="$rama $j $i" - lista[$j]=$i + lista[$j]=$i #Array with the names of branches let j++ fi done