From 0e705cfdbf85fccc23db337c91c00728772006c5 Mon Sep 17 00:00:00 2001 From: JoseluCross Date: Thu, 1 Sep 2016 12:39:52 +0200 Subject: [PATCH 1/3] Repair gitdit (TODO prove) --- jka-toolkit/.gitdit.swp | Bin 0 -> 20480 bytes jka-toolkit/gitdit | 17 +++++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 jka-toolkit/.gitdit.swp diff --git a/jka-toolkit/.gitdit.swp b/jka-toolkit/.gitdit.swp new file mode 100644 index 0000000000000000000000000000000000000000..6074d3bf85727447acadb42799d88c8e629c0f01 GIT binary patch literal 20480 zcmeI2ZEPGz8OJwGA-#r%rY)!v5T5K^lQZf0t)-x(=fv2~OPe}TLy`|6A#=N9-`aP( zm)*TMc9RfQAe06bidsQG6evOkMIcq;B~p2f8mXZmD)EUA6?{OvN~l1iLI5HD&&=-L z`fMjbid3nZvwpt4-JRK)|I9qk?95Z^-?!r-`cUt^7CyIH)|1OF?ys%hXkB=lWlaT< zY_y#)h$6nadhqkvJsC}0#Y3K#|61OC)`0hc72x+bTh?#DSHaUj zfB|p`<@gJD9()~exxNOz0GmQ>@GN*5Yyqpl4^~*# zm%(Z9C>R6p2RDNo!GGV5a)al)?;z zd*Cei5_k$60i$3wD1cY6VDb}i4txuI7CZ{(Km_)KDp&z7V{zv1;LqSQU5+yP#o|B-VHw_p z=O8pA@DH9)X}k$KK&5&x6SQKglHIoH;HJ1PeRY*{a_Z8V4%+dRvQfFLrOF)5dqys+ z{G+RfT~9QENvc$$*yXHofM}FPqb5QeH>KYudyi~LE~uo2APy)YL6K<0BDAR=fA^_p ziNjn_7q`umpdn+L+OVOZP8O2tPaUk5MEe*Ohr>|J(u^0^2~{OuG-X7=1l2;}qq>n! z#m}tTTp>ZFDdMEIx}r71&q1olBQ%h!X4VEtlN1VkTXjI^s1wRC3{Xv^?9Zp{RHD<8 zg@U>{O<%~KOx0?qJ-mY_s1m3Gq6tgFiQA$v*p;^~!33UME|XX7-{jq2dZe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q*cnR;T6WTmX-QQ(zVx0k?y{LA#6KEI0v< zf)W-G#`|!>*I3o#pMkV5xX7 Date: Fri, 16 Sep 2016 11:28:11 +0200 Subject: [PATCH 2/3] Repair jkazip, zip compresion have recursive mode --- jka-toolkit/jkazip | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/jka-toolkit/jkazip b/jka-toolkit/jkazip index 73fcdb3..b691ba9 100755 --- a/jka-toolkit/jkazip +++ b/jka-toolkit/jkazip @@ -30,7 +30,7 @@ function msg() { local var="$1" local var2="$2" printf -- "$(gettext "File/s %s has/have been compressed in %s")" "$var" "$var2" - echo + echo } #Function msg2, print in stdout a final message function msg2() { @@ -39,7 +39,7 @@ function msg2() { echo } -version="2.3.0" +version="2.3.1" if [ -z "$1" ];then echo "$(gettext "No option specified, use jkazip -h")" > /dev/stderr elif [ "$1" = "-h" ];then @@ -122,9 +122,9 @@ elif [ "$1" = "-c" ];then ### Funcion nueva for compfile in "$@"; do if [[ "$compfile" != "$1" && "$compfile" != "$2" ]];then - if [ ! -d "$compfile" -a ! -f "$compfile" ];then + if [[ ! -d "$compfile" && ! -f "$compfile" ]];then printf -- "$(gettext "%s no such file or directory")" "$compfile" - echo + echo #exit fi fi @@ -154,7 +154,7 @@ elif [ "$1" = "-c" ];then msg "$files" "$salida" ;; "zip") - zip "$salida" $files + zip -r "$salida" $files msg "$files" "$salida" ;; "gz" | "lz") @@ -189,7 +189,7 @@ elif [ "$1" = "-l" ];then tar taf "$2" ;; "7z") - 7z l "$2" + 7z l "$2" ;; "zip") uzip -v "$2" From 70a4fa757897a31119c415c6d1ac0573b28c4929 Mon Sep 17 00:00:00 2001 From: JoseluCross Date: Fri, 16 Sep 2016 11:37:03 +0200 Subject: [PATCH 3/3] Update version number --- jka-toolkit/gitdit | 250 ++++++++++++++++++++++----------------------- 1 file changed, 125 insertions(+), 125 deletions(-) diff --git a/jka-toolkit/gitdit b/jka-toolkit/gitdit index 1ad1af8..230ebd3 100755 --- a/jka-toolkit/gitdit +++ b/jka-toolkit/gitdit @@ -1,138 +1,138 @@ #!/bin/bash -# gitdit, a dialog interface to manage git repositories +# gitdit, a dialog interface to manage git repositories # Author: JKA Network - contacto@jkanetwork.com -VERSION="1.0.2" +VERSION="1.0.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 repo (Hacer clone)" i "Inicializar nuevo repo"` +gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface $VERSION" 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 rama " m "Unir ramas (Hacer merge)"` actual="origin $(git branch --list | grep "^*" | cut -f2 -d" ")" #Current branch actual2=$(git branch --list | grep "^*" | cut -f2 -d" ") #Current branch name fi if [ ! -z $gitopt ];then #No canceled - case $gitopt in - #Not staying in a git repo - "i") - gitdir=`dialog --stdout --inputbox "Directorio del repositorio" 10 60 "."` - if [ $(echo $gitdir | cut -f1 -d"/") = "~" ];then #~ don't understand like $HOME - gitdirdef="$HOME" - for (( i=2; i<=$cant; i++ )) - do - gitdirdef="$gitdirdef/$(echo $gitdir | cut -f$i -d"/")" - done - elif [ $(echo $gitdit | cut -f1 -d"/") = "." ];then - gitdirdef=$(pwd) - for (( i=1; i<=$cant; i++ )) - do - gitdirdef="$gitdirdef/$(echo $gitdir | cut -f$i -d"/")" - done - fi - if [ ! -d $gitdir ];then - mkdir -p $gitdirdef +case $gitopt in + #Not staying in a git repo + "i") + gitdir=`dialog --stdout --inputbox "Directorio del repositorio" 10 60 "."` + if [ $(echo $gitdir | cut -f1 -d"/") = "~" ];then #~ don't understand like $HOME + gitdirdef="$HOME" + for (( i=2; i<=$cant; i++ )) + do + gitdirdef="$gitdirdef/$(echo $gitdir | cut -f$i -d"/")" + done +elif [ $(echo $gitdit | cut -f1 -d"/") = "." ];then + gitdirdef=$(pwd) + for (( i=1; i<=$cant; i++ )) + do + gitdirdef="$gitdirdef/$(echo $gitdir | cut -f$i -d"/")" + done +fi +if [ ! -d $gitdir ];then + mkdir -p $gitdirdef +fi +if [ $? -eq 1 ];then + echo "No tienes permiso para escribir en ese directorio" >> /dev/stderr +else + cd $gitdirdef + git init +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 +;; +#Staying in a git repo +"p") +git pull $actual;; +"s") +estado=$(git status | grep -E '(^Changes|^Untracked)' ) #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 + commit="changes" +fi +git add . && git commit -m "$commit" +;; +"b") +howopt=`dialog --stdout --scrollbar --menu "Cambiar de rama" 0 0 6 c "Solo cambiar de rama" u "Cambiar de rama y actualizarla"` +if [ -z $howopt ];then + exit +fi +j=0 +rama="" +#Loop to create dialog whith all branches (except the current) +for i in $(git branch -a | grep -v "^*" | grep -v "HEAD \->") +do + aux2=0 + if [ -z $(echo $i | grep -o "remotes") ];then + aux=$i + aux2=1 + else + aux=$(echo $i | cut -f3 -d"/") + error=0 #If 1 aux is yet in lista array + for (( i=0;i<${#lista[@]} && error==0;i++ )) + do + if [ $aux == ${lista[$i]} -o $aux = $actual2 ];then + error=1 fi - if [ $? -eq 1 ];then - echo "No tienes permiso para escribir en ese directorio" >> /dev/stderr - else - cd $gitdirdef - git init - 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 - ;; - #Staying in a git repo - "p") - git pull $actual;; - "s") - estado=$(git status | grep -E '(^Changes|^Untracked)' ) #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 - commit="changes" - fi - git add . && git commit -m "$commit" - ;; - "b") - howopt=`dialog --stdout --scrollbar --menu "Cambiar de rama" 0 0 6 c "Solo cambiar de rama" u "Cambiar de rama y actualizarla"` - if [ -z $howopt ];then - exit - fi - j=0 - rama="" - #Loop to create dialog whith all branches (except the current) - for i in $(git branch -a | grep -v "^*" | grep -v "HEAD \->") - do - aux2=0 - if [ -z $(echo $i | grep -o "remotes") ];then - aux=$i - aux2=1 - else - aux=$(echo $i | cut -f3 -d"/") - error=0 #If 1 aux is yet in lista array - for (( i=0;i<${#lista[@]} && error==0;i++ )) - do - if [ $aux == ${lista[$i]} -o $aux = $actual2 ];then - error=1 - fi - done - if [ $error -eq 0 ];then - aux2=1 - fi - fi - if [ $aux2 -eq 1 ];then - rama="$rama $j $aux" - lista[$j]=$aux #Array with the names of branches - 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]} - if [ $howopt = "u" ];then - git pull origin ${lista[$ramificacion]} - fi - 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 $actual - fi - ;; - esac -fi \ No newline at end of file + done + if [ $error -eq 0 ];then + aux2=1 + fi + fi + if [ $aux2 -eq 1 ];then + rama="$rama $j $aux" + lista[$j]=$aux #Array with the names of branches + 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]} + if [ $howopt = "u" ];then + git pull origin ${lista[$ramificacion]} + fi +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 $actual +fi +;; +esac +fi