X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-pull.sh;h=3a139849fbfc545b7c479dd2889a0285fab646d5;hb=61f693bd5a2ab4d830aad6fce0a1c70863f38009;hp=e23d4f559790fed079bb5759fd5aa11a8804f191;hpb=d8ae1d10cd08ff1f0b749222d083446ef7bd8f3f;p=git.git diff --git a/git-pull.sh b/git-pull.sh index e23d4f55..3a139849 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -4,10 +4,17 @@ # # Fetch one or more remote refs and merge it/them into the current HEAD. -. git-sh-setup || die "Not a git archive" +. git-sh-setup usage () { - die "git pull [-n] [--no-commit] [-s strategy]... ..." + echo >&2 "usage: $0"' [-n] [--no-commit] [--no-summary] [--help] + [-s strategy]... + [] + ... + +Fetch one or more remote refs and merge it/them into the current HEAD. +' + exit 1 } strategy_args= no_summary= no_commit= @@ -33,6 +40,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 +79,22 @@ case "$merge_head" in exit 0 ;; ?*' '?*) - strategy_default_args='-s octopus' + var=`git-var -l | sed -ne 's/^pull\.octopus=/-s /p'` + if test '' = "$var" + then + strategy_default_args='-s octopus' + else + strategy_default_args=$var + fi ;; *) - strategy_default_args='-s resolve' + var=`git-var -l | sed -ne 's/^pull\.twohead=/-s /p'` + if test '' = "$var" + then + strategy_default_args='-s recursive' + else + strategy_default_args=$var + fi ;; esac