git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 5/11] Honor pull.{twohead,octopus} in git-merge.

From
Shawn O. Pearce <spearce@spearce.org>
Date
Dec 28, 2006, 07:35 UTC
Message-ID
<20061228073505.GE17867@spearce.org>
In-Reply-To
<9847899e4ba836980dbfed6d0ea1c82f31f21456.1167290864.git.spearce@spearce.org>

If git-merge is invoked without a strategy argument it is probably being run as a porcelain-ish command directly and is not being run from within git-pull. However we still should honor whatever merge strategy the user may have selected in their configuration, just as `git-pull .` would have.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 git-merge.sh |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/git-merge.sh b/git-merge.sh
index c7e033c..a8f673e 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -272,9 +272,21 @@ case "$use_strategies" in
 '')
 	case "$#" in
 	1)
-		use_strategies="$default_twohead_strategies" ;;
+		var="`git-repo-config --get pull.twohead`"
+		if test -n "$var"
+		then
+			use_strategies="$var"
+		else
+			use_strategies="$default_twohead_strategies"
+		fi ;;
 	*)
-		use_strategies="$default_octopus_strategies" ;;
+		var="`git-repo-config --get pull.octopus`"
+		if test -n "$var"
+		then
+			use_strategies="$var"
+		else
+			use_strategies="$default_octopus_strategies"
+		fi ;;
 	esac
 	;;
 esac
-- 
1.4.4.3.gd2e4
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 4 of 17 in “Honor GIT_REFLOG_ACTION in git-rebase.”
  1. 2/11 Honor GIT_REFLOG_ACTION in git-rebase.Shawn O. Pearce, Dec 28, 2006
  2. 3/11 Use branch names in 'git-rebase -m' conflict hunks.Shawn O. Pearce, Dec 28, 2006
  3. 4/11 Ensure `git-pull` fails if `git-merge` fails.Shawn O. Pearce, Dec 28, 2006
  4. 5/11 Honor pull.{twohead,octopus} in git-merge.Shawn O. Pearce, Dec 28, 2006
  5. 6/11 Allow git-merge to select the default strategy.Shawn O. Pearce, Dec 28, 2006
  6. 7/11 Avoid git-fetch in `git-pull .` when possible.Shawn O. Pearce, Dec 28, 2006
  7. Junio C HamanoDec 28, 2006
  8. Shawn PearceDec 28, 2006
  9. Junio C HamanoDec 28, 2006
  10. 8/11 Move better_branch_name above get_ref in merge-recursive.Shawn O. Pearce, Dec 28, 2006
  11. 9/11 Allow merging bare trees in merge-recursive.Shawn O. Pearce, Dec 28, 2006
  12. Junio C HamanoDec 28, 2006
  13. 10/11 Use merge-recursive in git-am -3.Shawn O. Pearce, Dec 28, 2006
  14. 11/11 Improve merge performance by avoiding in-index merges.Shawn O. Pearce, Dec 28, 2006
  15. Junio C HamanoDec 28, 2006
  16. Shawn PearceDec 28, 2006
  17. Johannes SchindelinDec 29, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.