Commit 45035e03 authored by Vitaly Lipatov's avatar Vitaly Lipatov

gpull: replace -n with -r/-m/-f options (do --ff-only by default)

parent f528a1ad
...@@ -8,9 +8,11 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then ...@@ -8,9 +8,11 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
echo "gpull - do git pull --rebase" echo "gpull - do git pull --rebase"
echo "Use: gpull [-a] [-n] [repo] [branch]" echo "Use: gpull [-a] [-n] [repo] [branch]"
echo " gpull without parameters or with branch name" echo " gpull without parameters or with branch name"
echo " gpull myrepo - for pull from remote myrepo gear repo" echo " gpull myrepo - for pull from remote myrepo gear repo (with --rebase by default)"
echo " -a - pull all branches" echo " -a - pull all branches"
echo " -n - do not rebase during pull" echo " -r - rebase during pull"
echo " -m - do merge if possible"
echo " -f - pull with fast forward only (default)"
echo " -c - return error status if repo was not uptodate (gpull || echo 'Was updated last time')" echo " -c - return error status if repo was not uptodate (gpull || echo 'Was updated last time')"
exit 1 exit 1
fi fi
...@@ -28,11 +30,20 @@ if [ "$1" = "-c" ] ; then ...@@ -28,11 +30,20 @@ if [ "$1" = "-c" ] ; then
fi fi
if [ "$1" = "-n" ] ; then REBASE="--ff-only"
if [ "$1" = "-r" ] ; then
REBASE="--rebase"
shift
fi
if [ "$1" = "-m" ] ; then
REBASE="" REBASE=""
shift shift
else fi
REBASE="--rebase"
if [ "$1" = "-f" ] ; then
REBASE="--ff-only"
shift
fi fi
if is_exist_remote_repo "$1" ; then if is_exist_remote_repo "$1" ; then
......
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