summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseluCross2016-06-30 02:54:29 +0200
committerJoseluCross2016-06-30 02:54:29 +0200
commita764e7f8bcc33ba646e68c6258ee0d1dcfdc697e (patch)
tree16f4e9e74f36c2ca7122bc97812f1baefe78d5e8
parent9c9d5c779ac605dfc5fe5afc3be54500b5665712 (diff)
downloadaur-a764e7f8bcc33ba646e68c6258ee0d1dcfdc697e.tar.gz
Update md5sums
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD4
-rw-r--r--gitdit91
3 files changed, 95 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f3e38efbbffc..112011b2b815 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,14 @@
pkgbase = gitdit
pkgdesc = gitdit - Git DIalog inTerface
pkgver = 0.2.2
- pkgrel = 1
+ pkgrel = 2
url = http://proyecto.jkanetwork.com
arch = any
groups = jka-toolkit
license = GPL3
options = !emptydirs
source = https://gitlab.com/JKANetwork/jka-toolkit/raw/master/jka-toolkit/gitdit
- md5sums = a6f7b8fc2a951c7b960a9c1fcbc92489
+ md5sums = 4347cf2c7e17ad7d7b7bfa7decf62cfc
pkgname = gitdit
diff --git a/PKGBUILD b/PKGBUILD
index 83b9c9bc65d9..6bb9c938a12f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: JKA Network (JoseluCross, Kprkpr, Yukialba) <contacto@jkanetwork.com>
pkgname=gitdit
pkgver=0.2.2
-pkgrel=1
+pkgrel=2
pkgdesc="gitdit - Git DIalog inTerface"
arch=('any')
url="http://proyecto.jkanetwork.com"
@@ -9,7 +9,7 @@ license=('GPL3')
groups=('jka-toolkit')
options=(!emptydirs)
source=("https://gitlab.com/JKANetwork/jka-toolkit/raw/master/jka-toolkit/gitdit")
-md5sums=('a6f7b8fc2a951c7b960a9c1fcbc92489')
+md5sums=('4347cf2c7e17ad7d7b7bfa7decf62cfc')
package() {
install -Dm755 $srcdir/gitdit "${pkgdir}/usr/bin/gitdit"
diff --git a/gitdit b/gitdit
new file mode 100644
index 000000000000..1b80a97f920d
--- /dev/null
+++ b/gitdit
@@ -0,0 +1,91 @@
+#!/bin/bash
+# gitdit, a dialog interface to manage git repositories
+# Author: JKA Network - contacto@jkanetwork.com
+
+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 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
+ #Not staying in a git repo
+ "i")
+ git init
+ ;;
+ "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 "^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
+ commit="changes"
+ fi
+ git add . && git commit -m "$commit"
+ ;;
+ "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 #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]}
+ 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
+fi \ No newline at end of file