git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] git-rebase fails when a commit message contains a diff
@ 2007-11-09  1:12 Jonas Fonseca
  2007-11-09  1:39 ` Junio C Hamano
  0 siblings, 1 reply; 17+ messages in thread
From: Jonas Fonseca @ 2007-11-09  1:12 UTC (permalink / raw)
  To: git

I have concocted a test that illustrates the problem: patch below.  The problem
is that the patches in .dotest are not properly formatted to make it easy to
distinguish commit message from commit diff.

When running the test git-rebase fails with:

	Applying Test message with diff in it
	error: config: does not exist in index
	fatal: sha1 information is lacking or useless (config).
	Repository lacks necessary blobs to fall back on 3-way merge.
	Cannot fall back to three-way merge.
	Patch failed at 0004.

By modifying the test below, a similar problem related with handling of the
end-of-message marker (---\n) can be exposed. A commit message that contains
this marker and text afterwards ends up only having the text preceeding the
marker.

diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index 95e33b5..75babdb 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -83,4 +83,25 @@ test_expect_success 'rebase a single mode change' '
      GIT_TRACE=1 git rebase master
 '
 
+cat >commitdiff-message <<EOF
+Test message with diff in it
+
+--- .git/config	2007-11-02 22:44:55.000000000 +0100
++++ .git/config+	2007-11-09 01:40:30.000000000 +0100
+@@ -1,3 +1,4 @@
++# Broken
+ [core]
+ 	repositoryformatversion = 0
+ 	filemode = true
+EOF
+
+test_expect_success 'rebase commit with diff in the commit message' \
+'
+     git checkout -b diff-msg upstream-merged-nonlinear &&
+     echo 1 > W &&
+     git add W &&
+     git commit -F commitdiff-message &&
+     git rebase master
+'
+
 test_done

-- 
Jonas Fonseca

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

end of thread, other threads:[~2007-11-11 22:31 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-09  1:12 [BUG] git-rebase fails when a commit message contains a diff Jonas Fonseca
2007-11-09  1:39 ` Junio C Hamano
2007-11-09  1:51   ` Junio C Hamano
2007-11-09  2:18     ` Junio C Hamano
2007-11-09  2:28       ` Johannes Schindelin
2007-11-09  2:37         ` Junio C Hamano
2007-11-09 14:19           ` Johannes Schindelin
2007-11-11 22:31           ` Björn Steinbrink
2007-11-09  7:57         ` Benoit Sigoure
2007-11-09  8:57           ` Johannes Sixt
2007-11-09  9:05             ` Ralf Wildenhues
2007-11-09  9:07             ` Benoit Sigoure
2007-11-09 13:20           ` Johannes Schindelin
2007-11-09 10:29         ` Andreas Ericsson
2007-11-09  7:03     ` Steffen Prohaska
2007-11-09 14:18       ` Johannes Schindelin
2007-11-09 14:29         ` Steffen Prohaska

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 NNTP newsgroup(s).