git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] Do not ignore merge options in interactive rebase
@ 2013-06-21  5:23 Arnaud Fontaine
  2013-06-21 20:43 ` Junio C Hamano
  0 siblings, 1 reply; 9+ messages in thread
From: Arnaud Fontaine @ 2013-06-21  5:23 UTC (permalink / raw)
  To: git; +Cc: Martin von Zweigbergk, Junio C Hamano

Merge strategy and its options can be specified in `git rebase`,
but with `--interactive`, they were completely ignored.

Signed-off-by: Arnaud Fontaine <arnau@debian.org>
---
 git-rebase--interactive.sh    | 11 ++++++++++-
 t/t3404-rebase-interactive.sh | 11 +++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 git-rebase--interactive.sh

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
old mode 100644
new mode 100755
index f953d8d..c157fdf
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -239,7 +239,16 @@ pick_one () {
 
 	test -d "$rewritten" &&
 		pick_one_preserving_merges "$@" && return
-	output git cherry-pick $empty_args $ff "$@"
+
+	if test -n "$do_merge"
+	then
+		test -z "$strategy" && strategy=recursive
+		output git cherry-pick --strategy=$strategy \
+			$(echo $strategy_opts | sed "s/'--\([^']*\)'/-X\1/g") \
+			$empty_args $ff "$@"
+	else
+		output git cherry-pick $empty_args $ff "$@"
+	fi
 }
 
 pick_one_preserving_merges () {
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 79e8d3c..8b6a36f 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -947,4 +947,15 @@ test_expect_success 'rebase -i respects core.commentchar' '
 	test B = $(git cat-file commit HEAD^ | sed -ne \$p)
 '
 
+test_expect_success 'rebase -i with --strategy and -X' '
+	git checkout -b conflict-merge-use-theirs conflict-branch &&
+	git reset --hard HEAD^ &&
+	echo five >conflict &&
+	echo Z >file1 &&
+	git commit -a -m "one file conflict" &&
+	EDITOR=true git rebase -i --strategy=recursive -Xours conflict-branch &&
+	test $(git show conflict-branch:conflict) = $(cat conflict) &&
+	test $(cat file1) = Z
+'
+
 test_done
-- 
1.8.3.GIT

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-07-02  8:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-21  5:23 [PATCH] Do not ignore merge options in interactive rebase Arnaud Fontaine
2013-06-21 20:43 ` Junio C Hamano
2013-06-24  7:40   ` Arnaud Fontaine
2013-06-24  7:47     ` Arnaud Fontaine
2013-06-25 17:04       ` Junio C Hamano
2013-06-25 20:28         ` Junio C Hamano
2013-07-02  8:05           ` Arnaud Fontaine
2013-07-02  8:05           ` Arnaud Fontaine
2013-06-24 14:16     ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).