X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-pull.sh;h=0991d5f14cd6d903572a041cfbfe3cde219c738f;hb=9470657ad0d0472e3e3c2e352334f60e7bd777c1;hp=96016270b4a1746ac1f075ed9fbcf62e754005e8;hpb=6ddc0964034342519a87fe013781abf31c6db6ad;p=git.git diff --git a/git-pull.sh b/git-pull.sh index 96016270..0991d5f1 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] [-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-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