Commit 7b88f264 authored by Vitaly Lipatov's avatar Vitaly Lipatov

gpush: add some heroustic for default behavior

parent 27822c7f
......@@ -6,13 +6,13 @@ load_mod git
test -r "$1" && fatal "Do not need any files in params"
# If run with remote alias like girar name, use only it
if is_girar_name $1 ; then
GIRARHOST=$1
OVERRIDEGIRARHOST=$1
shift
fi
if [ "$1" = "-h" ] ; then
echo "gpush - publish current project repo remote git repo"
echo "Use: gpush [GIRAR] [-f|--force] [-a|--all] [-t|--tags] [target branch]"
......@@ -39,11 +39,10 @@ fi
REMOTELIST="$(get_remote_git_list)"
# disable use one target if it one
if false && is_one_girar_name "$REMOTELIST" ; then
# use one target if it one
if is_one_girar_name "$REMOTELIST" && [ -z "$OVERRIDEGIRARHOST" ] ; then
GIRARHOST="$REMOTELIST"
OVERRIDEGIRARHOST=$GIRARHOST
shift
fi
# use as project name
......@@ -61,7 +60,7 @@ if [ -z "$CURRENTBRANCH" ] ; then
exit 1
fi
if [ "$1" = "origin" ] ; then
if [ "$1" = "origin" ]; then
REPO="$1"
shift
git push $PUSHALL $PUSHFORCE $REPO $@
......@@ -69,6 +68,13 @@ if [ "$1" = "origin" ] ; then
exit
fi
if [ "$(git remote | uniq)" = "origin" ] ; then
REPO="origin"
git push $PUSHALL $PUSHFORCE $REPO $@
git push --tags $PUSHALL $PUSHFORCE $REPO $@
exit
fi
if [ -n "$1" ] ; then
TARGETBRANCH="$1"
shift
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment