| @ -1,20 +0,0 @@ | |||||
| #!/bin/env bash | |||||
| git_current_branch() { | |||||
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | |||||
| } | |||||
| CUR_BRANCH=`git_current_branch` | |||||
| CIBLE=$1 | |||||
| if [ "$CIBLE" == "" ] | |||||
| then | |||||
| CIBLE=$CUR_BRANCH | |||||
| fi | |||||
| git_01_quick_commit.sh | |||||
| if [ ! "$CIBLE" = "$CUR_BRANCH" ]; | |||||
| then | |||||
| git checkout $CIBLE | |||||
| git pull | |||||
| fi | |||||
| @ -1,26 +1,21 @@ | |||||
| #!/bin/env bash | #!/bin/env bash | ||||
| git_current_branch() { | |||||
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | |||||
| } | |||||
| CUR_BRANCH=`git_current_branch` | |||||
| CIBLE=$1 | CIBLE=$1 | ||||
| if [ "$CIBLE" == "" ] | if [ "$CIBLE" == "" ] | ||||
| then | then | ||||
| CIBLE=$CUR_BRANCH | |||||
| CIBLE=$GIT_CURRENT_BRANCH | |||||
| fi | fi | ||||
| git_01_quick_commit.sh | git_01_quick_commit.sh | ||||
| if [ ! "$CIBLE" = "$CUR_BRANCH" ]; | |||||
| if [ ! "$CIBLE" = "$GIT_CURRENT_BRANCH" ]; | |||||
| then | then | ||||
| git_00_checkout_branch.sh $CIBLE | git_00_checkout_branch.sh $CIBLE | ||||
| fi | fi | ||||
| git push all | git push all | ||||
| if [ ! "$CIBLE" = "$CUR_BRANCH" ]; | |||||
| if [ ! "$CIBLE" = "$GIT_CURRENT_BRANCH" ]; | |||||
| then | then | ||||
| git_00_checkout_branch.sh $CUR_BRANCH | |||||
| git_00_checkout_branch.sh $GIT_CURRENT_BRANCH | |||||
| fi | fi | ||||
| @ -1,14 +1,9 @@ | |||||
| #!/bin/env bash | #!/bin/env bash | ||||
| git_current_branch() { | |||||
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | |||||
| } | |||||
| CUR_BRANCH=`git_current_branch` | |||||
| CIBLE=$1 | CIBLE=$1 | ||||
| if [ "$CIBLE" == "" ] | if [ "$CIBLE" == "" ] | ||||
| then | then | ||||
| CIBLE=$CUR_BRANCH | |||||
| CIBLE=$GIT_CURRENT_BRANCH | |||||
| fi | fi | ||||
| internal_delete_branch() { | internal_delete_branch() { | ||||
| @ -27,7 +22,7 @@ delete_branch() { | |||||
| git_03_push_branch.sh | git_03_push_branch.sh | ||||
| if [ ! "$CUR_BRANCH" = "develop" ] | |||||
| if [ ! "$GIT_CURRENT_BRANCH" = "develop" ] | |||||
| then | then | ||||
| echo "La branche actuelle n'est pas develop" | echo "La branche actuelle n'est pas develop" | ||||
| read -p "Voulez-vous basculer sur develop ? " -n 1 -r | read -p "Voulez-vous basculer sur develop ? " -n 1 -r | ||||
| @ -39,7 +34,7 @@ then | |||||
| fi | fi | ||||
| case $CIBLE in | case $CIBLE in | ||||
| ($CUR_BRANCH) echo "Impossible : $CIBLE is current branch !";; | |||||
| ($GIT_CURRENT_BRANCH) echo "Impossible : $CIBLE is current branch !";; | |||||
| ("evo"*) delete_branch $CIBLE;; | ("evo"*) delete_branch $CIBLE;; | ||||
| ("ano"*) delete_branch $CIBLE;; | ("ano"*) delete_branch $CIBLE;; | ||||
| (*) echo "$CIBLE is not a feature branch";; | (*) echo "$CIBLE is not a feature branch";; | ||||
| @ -0,0 +1,15 @@ | |||||
| #!/bin/env bash | |||||
| CIBLE=$1 | |||||
| if [ "$CIBLE" == "" ] | |||||
| then | |||||
| CIBLE=$GIT_CURRENT_BRANCH | |||||
| fi | |||||
| git_01_quick_commit.sh | |||||
| if [ ! "$CIBLE" = "$GIT_CURRENT_BRANCH" ]; | |||||
| then | |||||
| git checkout $CIBLE | |||||
| git pull | |||||
| fi | |||||
| @ -1,14 +1,9 @@ | |||||
| #!/bin/env bash | #!/bin/env bash | ||||
| git_current_branch() { | |||||
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | |||||
| } | |||||
| CUR_BRANCH=`git_current_branch` | |||||
| TEST=`git status | grep propre | wc -l` | TEST=`git status | grep propre | wc -l` | ||||
| if [ $TEST -eq 0 ] | if [ $TEST -eq 0 ] | ||||
| then | then | ||||
| echo "La branche actuelle ($CUR_BRANCH) n'est pas propre" | |||||
| echo "La branche actuelle ($GIT_CURRENT_BRANCH) n'est pas propre" | |||||
| echo # (optional) move to a new line | echo # (optional) move to a new line | ||||
| read -p "Voulez-vous voir les modifications courantes ? " -n 1 -r | read -p "Voulez-vous voir les modifications courantes ? " -n 1 -r | ||||
| @ -1,9 +1,14 @@ | |||||
| #!/bin/env bash | #!/bin/env bash | ||||
| git_parse_branches() { | |||||
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | |||||
| } | |||||
| git_current_branch() { | git_current_branch() { | ||||
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | |||||
| export GIT_CURRENT_BRANCH="$(git_parse_branches)" | |||||
| } | } | ||||
| export CUR_BRANCH=`git_current_branch`o | |||||
| git_current_branch | |||||
| usage(){ | usage(){ | ||||
| echo | echo | ||||
| @ -22,8 +27,8 @@ GITCMD=$1 | |||||
| shift | shift | ||||
| case $GITCMD in | case $GITCMD in | ||||
| ("checkout") git_00_checkout_branch.sh $@;; | |||||
| ("status") git_00_status.sh $@;; | |||||
| ("checkout") git_98_checkout_branch.sh $@;; | |||||
| ("status") git_99_status.sh $@;; | |||||
| ("commit") git_01_quick_commit.sh $@;; | ("commit") git_01_quick_commit.sh $@;; | ||||
| ("add") git_02_add_branch.sh $@;; | ("add") git_02_add_branch.sh $@;; | ||||
| ("push") git_03_push_branch.sh $@;; | ("push") git_03_push_branch.sh $@;; | ||||