X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-pull.sh;h=29c14e148e1ff5b6f7bc0d8aca705961f0957eb8;hb=ac5a85181ac18b0119705f46cfa825389643df33;hp=e23d4f559790fed079bb5759fd5aa11a8804f191;hpb=d8ae1d10cd08ff1f0b749222d083446ef7bd8f3f;p=git.git diff --git a/git-pull.sh b/git-pull.sh index e23d4f55..29c14e14 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,18 @@ case "$merge_head" in exit 0 ;; ?*' '?*) - strategy_default_args='-s octopus' + var=`git-repo-config --get pull.octopus` + if test -n "$var" + then + strategy_default_args="-s $var" + fi ;; *) - strategy_default_args='-s resolve' + var=`git-repo-config --get pull.twohead` + if test -n "$var" + then + strategy_default_args="-s $var" + fi ;; esac