Skip to content

Commit

Permalink
Make git-recursive the default strategy for git-pull.
Browse files Browse the repository at this point in the history
This does two things:

 - It changes the hardcoded default merge strategy for two-head
   git-pull from resolve to recursive.

 - .git/config file acquires two configuration items.
   pull.twohead names the strategy for two-head case, and
   pull.octopus names the strategy for octopus merge.

IOW you are paranoid, you can have the following lines in your
.git/config file and keep using git-merge-resolve when pulling
one remote:

	[pull]
		twohead = resolve

OTOH, you can say this:

	[pull]
		twohead = resolve
		twohead = recursive

to try quicker resolve first, and when it fails, fall back to
recursive.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Nov 10, 2005
1 parent 1395667 commit a1c2929
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions git-pull.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,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

Expand Down

0 comments on commit a1c2929

Please sign in to comment.