Re: [PATCH 2/2] rebase -i -p: Fix --continue after a merge could not be redone

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, 22 Dec 2008, Johannes Schindelin wrote:

> I'll leave the commit message fixing to you, but the --cc patch probably 
> looks something like this -- feel free to squash in:
> 
> ---
> [... a patch ...]

Ooops.  Scratch that.  I tested without running the test suite, and sure 
enough, it failed.  Take that instead.

--

 git-rebase--interactive.sh |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 89c39eb..f08409c 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -115,9 +115,21 @@ mark_action_done () {
 }
 
 make_patch () {
-	parent_sha1=$(git rev-parse --verify "$1"^) ||
-		die "Cannot get patch for $1^"
-	git diff-tree -p "$parent_sha1".."$1" > "$DOTEST"/patch
+	sha1_and_parents="$(git rev-list --parents -1 $1)"
+	case "$sha1_and_parents" in
+	*' '*' '*' '*)
+		echo "Octopus merge"
+	;;
+	*' '*' '*)
+		git diff --cc $sha1_and_parents
+	;;
+	*' '*)
+		git diff-tree -p $1^!
+	;;
+	*)
+		echo "Root commit"
+	;;
+	esac > "$DOTEST"/patch
 	test -f "$DOTEST"/message ||
 		git cat-file commit "$1" | sed "1,/^$/d" > "$DOTEST"/message
 	test -f "$DOTEST"/author-script ||
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux