mirror of
https://gitlab.com/JKANetwork/jka-toolkit.git
synced 2026-02-14 09:01:31 +01:00
Ident file and grammar fix
This commit is contained in:
@@ -13,8 +13,8 @@ else #Else, all other options
|
||||
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
|
||||
case $gitopt in
|
||||
#Options not in a git repo
|
||||
"i")
|
||||
gitdir=`dialog --stdout --inputbox "Repo directory" 10 60 "."`
|
||||
if [ $(echo $gitdir | cut -f1 -d"/") = "~" ];then #~ don't understand like $HOME
|
||||
@@ -23,63 +23,65 @@ case $gitopt in
|
||||
do
|
||||
gitdirdef="$gitdirdef/$(echo $gitdir | cut -f$i -d"/")"
|
||||
done
|
||||
elif [ $(echo $gitdit | cut -f1 -d"/") = "." ];then
|
||||
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
|
||||
fi
|
||||
if [ ! -d $gitdir ];then
|
||||
mkdir -p $gitdirdef
|
||||
fi
|
||||
if [ $? -eq 1 ];then
|
||||
fi
|
||||
if [ $? -eq 1 ];then
|
||||
echo "You dont have permission to write in this directory" >> /dev/stderr
|
||||
else
|
||||
else
|
||||
cd $gitdirdef
|
||||
git init
|
||||
fi
|
||||
;;
|
||||
"c")
|
||||
giturl=`dialog --stdout --inputbox "URL del git" 10 60`
|
||||
if [ -z $giturl ];then
|
||||
echo "No repository there."
|
||||
fi
|
||||
;;
|
||||
"c")
|
||||
giturl=`dialog --stdout --inputbox "git URL: " 10 60`
|
||||
if [ -z $giturl ];then
|
||||
echo "No URL specified."
|
||||
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 "Changes text: " 10 50 "changes"`
|
||||
if [[ -z $commit ]];then
|
||||
fi
|
||||
git clone $giturl
|
||||
;;
|
||||
|
||||
|
||||
#Options of 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 "Changes text: " 10 50 "changes"`
|
||||
if [[ -z $commit ]];then
|
||||
commit="changes"
|
||||
fi
|
||||
git add -A && git commit -m "$commit" && git push $actual
|
||||
else #Nothing to commit, only push
|
||||
fi
|
||||
git add -A && git commit -m "$commit" && git push $actual
|
||||
else #Nothing to commit, only push
|
||||
git push $actual
|
||||
fi
|
||||
;;
|
||||
"t")
|
||||
commit=`dialog --stdout --inputbox "Changes text: " 10 50 "changes"`
|
||||
if [[ -z $commit ]];then
|
||||
fi
|
||||
;;
|
||||
"t")
|
||||
commit=`dialog --stdout --inputbox "Changes text: " 10 50 "changes"`
|
||||
if [[ -z $commit ]];then
|
||||
commit="changes"
|
||||
fi
|
||||
git add -A && git commit -m "$commit"
|
||||
;;
|
||||
"b")
|
||||
howopt=`dialog --stdout --scrollbar --menu "Change branch" 0 0 6 c "Only change branch" u "Change branch and update it"`
|
||||
if [ -z $howopt ];then
|
||||
fi
|
||||
git add -A && git commit -m "$commit"
|
||||
;;
|
||||
"b")
|
||||
howopt=`dialog --stdout --scrollbar --menu "Change branch" 0 0 6 c "Only change branch" u "Change branch and update it"`
|
||||
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
|
||||
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
|
||||
@@ -102,48 +104,48 @@ do
|
||||
lista[$j]=$aux #Array with the names of branches
|
||||
let j++
|
||||
fi
|
||||
done
|
||||
ramificacion=`dialog --stdout --scrollbar --menu "Select branch to goto" 0 0 6 $rama`
|
||||
if [ ! -z $ramificacion ];then
|
||||
done
|
||||
ramificacion=`dialog --stdout --scrollbar --menu "Select branch to goto" 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 "Name of the new branch" 10 50 "New branch"`
|
||||
if [ ! -z $NewBranch ];then
|
||||
fi
|
||||
;;
|
||||
"n")
|
||||
NewBranch=`dialog --stdout --inputbox "Name of the new branch" 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
|
||||
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 "Select branch for merge to $(git branch --list | grep "^*" | cut -f2 -d" ")" 0 0 6 $rama`
|
||||
if [ ! -z $merges ];then
|
||||
done
|
||||
merges=`dialog --stdout --scrollbar --menu "Select branch for merge to $(git branch --list | grep "^*" | cut -f2 -d" ")" 0 0 6 $rama`
|
||||
if [ ! -z $merges ];then
|
||||
git merge ${lista[$merges]}
|
||||
git push $actual
|
||||
fi
|
||||
;;
|
||||
"d")
|
||||
var=1
|
||||
while [[ $var -eq 1 ]]; do
|
||||
fi
|
||||
;;
|
||||
"d")
|
||||
var=1
|
||||
while [[ $var -eq 1 ]]; do
|
||||
if [[ $(ls -a | grep .git) ]]; then
|
||||
var=0
|
||||
else
|
||||
cd ..
|
||||
fi
|
||||
done
|
||||
git checkout .;
|
||||
;;
|
||||
esac
|
||||
done
|
||||
git checkout .;
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user