Skip to contentSkip to conversation

Use resolve in git-pull if NO_PYTHON

PATCH In review Mark Hollomon 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use resolve in git-pull if NO_PYTHON

git-pull is hardcoded to use the recursive merge strategy for the twohead case. But if git has been built with NO_PYTHON, that strategy is not available. Teach git-pull to use resolve if built with NO_PYTHON.

---

 git-pull.sh |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

1eb3abec6f4811e3eeafa50445ed0f2ce5d85b08

git-pull.sh +6 -1
index 6caf1aa..ae9c346 100755
@@ -8,6 +8,11 @@ USAGE='[-n | --no-summary] [--no-commit]
 LONG_USAGE='Fetch one or more remote refs and merge it/them into the current HEAD.'
 . git-sh-setup
 
+default_twohead_strategy='recursive'
+if test "@@NO_PYTHON@@"; then
+    default_twohead_strategy='resolve'
+fi
+
 strategy_args= no_summary= no_commit=
 while case "$#,$1" in 0) break ;; *,-*) ;; *) break ;; esac
 do
@@ -82,7 +87,7 @@ case "$merge_head" in
 	var=`git repo-config --get pull.twohead`
 	if test '' = "$var"
 	then
-		strategy_default_args='-s recursive'
+		strategy_default_args="-s $default_twohead_strategy"
 	else
 		strategy_default_args="-s $var"
 	fi
Signature · 1 line
1.2.4.g967a
#1 lore raw

Hi,

Quoted 4 lines · Mark Hollomon

git-pull is hardcoded to use the recursive merge strategy for the twohead case. But if git has been built with NO_PYTHON, that strategy is not available. Teach git-pull to use resolve if built with NO_PYTHON.

D'oh. I forgot to send that patch when I was doing the NO_PYTHON stuff. But I did it differently: There is no good reason that git-pull should insist on its own default strategy when git-merge already has one.

Ciao,
Dscho