X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-pull.sh;h=6caf1aad471bbf8f894ea20a80c3be082012648b;hb=2d33501689989616a2dc003ca80fafa60b1ed5da;hp=e23d4f559790fed079bb5759fd5aa11a8804f191;hpb=72e5890b68e7199d92620d3bba91fa36dd259404;p=git.git diff --git a/git-pull.sh b/git-pull.sh index e23d4f55..6caf1aad 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -4,11 +4,9 @@ # # Fetch one or more remote refs and merge it/them into the current HEAD. -. git-sh-setup || die "Not a git archive" - -usage () { - die "git pull [-n] [--no-commit] [-s strategy]... ..." -} +USAGE='[-n | --no-summary] [--no-commit] [-s strategy]... [] ...' +LONG_USAGE='Fetch one or more remote refs and merge it/them into the current HEAD.' +. git-sh-setup strategy_args= no_summary= no_commit= while case "$#,$1" in 0) break ;; *,-*) ;; *) break ;; esac @@ -33,6 +31,9 @@ do esac strategy_args="${strategy_args}-s $strategy " ;; + -h|--h|--he|--hel|--help) + usage + ;; -*) # Pass thru anything that is meant for fetch. break @@ -69,10 +70,22 @@ case "$merge_head" in exit 0 ;; ?*' '?*) - strategy_default_args='-s octopus' + var=`git repo-config --get pull.octopus` + if test '' = "$var" + then + strategy_default_args='-s octopus' + else + strategy_default_args="-s $var" + fi ;; *) - strategy_default_args='-s resolve' + var=`git repo-config --get pull.twohead` + if test '' = "$var" + then + strategy_default_args='-s recursive' + else + strategy_default_args="-s $var" + fi ;; esac