X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=git-pull.sh;h=3a139849fbfc545b7c479dd2889a0285fab646d5;hb=562051809589574576971c53c23aad93f8c395d9;hp=96016270b4a1746ac1f075ed9fbcf62e754005e8;hpb=123ee3ca7b57c32bb3ecd8cfede20dbb9dd5a8a8;p=git.git diff --git a/git-pull.sh b/git-pull.sh index 96016270..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] [-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