Thread (1 message) 1 message, 1 author, 2016-06-15
DORMANTno replies

[PATCH 4/4] rebase: make it usable for binary files as well.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:12
Subsystem: the rest · Maintainer: Linus Torvalds

Use git-format-patch --full-index to generate a patch, and feed
that to git-am that uses git-apply --allow-binary-replacement.
This way, rebase can be used to move development that contains
binary files as long as there is no need for file-level merges.

Signed-off-by: Junio C Hamano <redacted>

---

 git-am.sh     |    7 ++++---
 git-rebase.sh |    2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

applies-to: 349326f3647597dabf38d82e1c2806cef45060f7
7f5bff7c3e5b1245e479fc13665641424dee9a41
diff --git a/git-am.sh b/git-am.sh
index 38841d9..8307d77 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -46,7 +46,7 @@ fall_back_3way () {
 	    cd "$dotest/patch-merge-tmp-dir" &&
 	    GIT_INDEX_FILE="../patch-merge-tmp-index" \
 	    GIT_OBJECT_DIRECTORY="$O_OBJECT" \
-	    git-apply --index <../patch
+	    git-apply --allow-binary-replacement --index <../patch
         )
     then
 	echo Using index info to reconstruct a base tree...
@@ -77,7 +77,7 @@ fall_back_3way () {
 		GIT_OBJECT_DIRECTORY="$O_OBJECT" &&
 		export GIT_INDEX_FILE GIT_OBJECT_DIRECTORY &&
 		git-read-tree "$base" &&
-		git-apply --index &&
+		git-apply --index --allow-binary-replacement &&
 		mv ../patch-merge-tmp-index ../patch-merge-index &&
 		echo "$base" >../patch-merge-base
 	    ) <"$dotest/patch"  2>/dev/null && break
@@ -310,7 +310,8 @@ do
 	echo "Applying '$SUBJECT'"
 	echo
 
-	git-apply --index "$dotest/patch"; apply_status=$?
+	git-apply --allow-binary-replacement --index "$dotest/patch"
+	apply_status=$?
 	if test $apply_status = 1 && test "$threeway" = t
 	then
 		if (fall_back_3way)
diff --git a/git-rebase.sh b/git-rebase.sh
index 56196e7..b8abf33 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -25,4 +25,4 @@ esac
 
 # Rewind the head to "$other"
 git-reset --hard "$other"
-git-format-patch -k --stdout "$other" ORIG_HEAD | git am -3 -k
+git-format-patch -k --stdout --full-index "$other" ORIG_HEAD | git am -3 -k
---
0.99.9.GIT
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help