login
Header Space

 
 

[RFC/PATCH] Make git-recursive the default strategy for git-pull.

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: <git@...>
Date: Tuesday, November 8, 2005 - 12:21 pm

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>

---

  Linus Torvalds <torvalds@osdl.org> writes:

  > Hmm. True. The _really_ trivial in-index case triggers for me pretty 
  > often, but I haven't done any statistics. It might be only 50% of the 
  > time.
  >...
  > It's certainly an option to just do what I just did, namely use the 
  > default one until it breaks, and then just do "git reset --hard" and re-do 
  > the pull with "-s recursive". A bit sad, and it would be good to have 
  > coverage on the recursive strategy..

  Hopefully something like this would make people aware of
  recursive and give it a wider coverage and chance to mature.

 git-pull.sh |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

applies-to: 75922cf23cc070e2d5220d961a8f645f1bc8bb60
3acc20beaf0df9ce11a1b7aabf8c9dc7507a9b44
diff --git a/git-pull.sh b/git-pull.sh
index 2358af6..3b875ad 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -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
 
---
0.99.9.GIT

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Comments on recursive merge.., Linus Torvalds, (Mon Nov 7, 12:48 pm)
Re: Comments on recursive merge.., Fredrik Kuivinen, (Mon Nov 7, 6:58 pm)
Re: Comments on recursive merge.., Junio C Hamano, (Mon Nov 7, 8:13 pm)
Re: Comments on recursive merge.., Linus Torvalds, (Mon Nov 7, 8:33 pm)
Re: Comments on recursive merge.., Junio C Hamano, (Fri Nov 11, 6:25 pm)
Re: Comments on recursive merge.., Ryan Anderson, (Sat Nov 12, 2:35 am)
[PATCH] GIT commit statistics., Junio C Hamano, (Sat Nov 12, 3:44 am)
Re: [PATCH] GIT commit statistics., Martin Langhoff, (Sat Nov 12, 8:19 am)
Re: [PATCH] GIT commit statistics., Petr Baudis, (Sun Nov 13, 7:11 am)
Re: [PATCH] GIT commit statistics., Junio C Hamano, (Sun Nov 13, 6:59 am)
Re: [PATCH] GIT commit statistics., Martin Langhoff, (Sun Nov 13, 4:42 pm)
Re: [PATCH] GIT commit statistics., Junio C Hamano, (Sun Nov 13, 11:33 pm)
Re: [PATCH] GIT commit statistics., Martin Langhoff, (Mon Nov 14, 12:01 am)
Re: [PATCH] GIT commit statistics., Junio C Hamano, (Mon Nov 14, 2:06 am)
Re: [PATCH] GIT commit statistics., Martin Langhoff, (Mon Nov 14, 4:51 am)
Re: [PATCH] GIT commit statistics., Junio C Hamano, (Mon Nov 14, 11:00 pm)
Re: [PATCH] GIT commit statistics., Junio C Hamano, (Mon Nov 14, 5:27 am)
Re: [PATCH] GIT commit statistics., Petr Baudis, (Mon Nov 14, 5:25 am)
Re: [PATCH] GIT commit statistics., Martin Langhoff, (Mon Nov 14, 5:25 pm)
Re: [PATCH] GIT commit statistics., Johannes Schindelin, (Sat Nov 12, 3:04 pm)
Re: [PATCH] GIT commit statistics., Petr Baudis, (Sat Nov 12, 8:53 am)
Re: [PATCH] GIT commit statistics., Catalin Marinas, (Tue Nov 15, 6:04 am)
Re: [PATCH] GIT commit statistics., Chuck Lever, (Tue Nov 15, 11:29 am)
Re: Comments on recursive merge.., Linus Torvalds, (Fri Nov 11, 6:53 pm)
Re: Comments on recursive merge.., Junio C Hamano, (Fri Nov 11, 8:42 pm)
[RFC/PATCH] Make git-recursive the default strategy for git-..., Junio C Hamano, (Tue Nov 8, 12:21 pm)
Re: Comments on recursive merge.., Johannes Schindelin, (Tue Nov 8, 7:58 am)
Re: Comments on recursive merge.., Fredrik Kuivinen, (Tue Nov 8, 5:02 pm)
Re: Comments on recursive merge.., Johannes Schindelin, (Tue Nov 8, 7:04 pm)
Re: Comments on recursive merge.., Linus Torvalds, (Tue Nov 8, 5:52 pm)
Re: Comments on recursive merge.., Fredrik Kuivinen, (Tue Nov 8, 6:36 pm)
Re: Comments on recursive merge.., Linus Torvalds, (Tue Nov 8, 7:05 pm)
Re: Comments on recursive merge.., Petr Baudis, (Tue Nov 8, 8:32 pm)
Re: Comments on recursive merge.., Linus Torvalds, (Tue Nov 8, 8:51 pm)
Re: Comments on recursive merge.., Junio C Hamano, (Tue Nov 8, 8:59 pm)
Re: Comments on recursive merge.., Linus Torvalds, (Tue Nov 8, 9:22 pm)
Re: Comments on recursive merge.., Junio C Hamano, (Tue Nov 8, 9:42 pm)
Re: Comments on recursive merge.., Johannes Schindelin, (Tue Nov 8, 7:18 pm)
Re: Comments on recursive merge.., Linus Torvalds, (Tue Nov 8, 8:18 pm)
Re: Comments on recursive merge.., Junio C Hamano, (Wed Nov 9, 2:10 am)
Re: Comments on recursive merge.., Junio C Hamano, (Tue Nov 8, 5:47 pm)
Re: Comments on recursive merge.., Junio C Hamano, (Mon Nov 7, 8:59 pm)
Re: Comments on recursive merge.., Linus Torvalds, (Mon Nov 7, 12:56 pm)
[PATCH] merge-recursive: Only print relevant rename messages, Fredrik Kuivinen, (Mon Nov 7, 7:19 pm)
speck-geostationary