From: Jonas Fonseca <fonseca@diku.dk>
To: git@vger.kernel.org
Subject: [BUG] git-rebase fails when a commit message contains a diff
Date: Fri, 9 Nov 2007 02:12:14 +0100 [thread overview]
Message-ID: <20071109011214.GA5903@diku.dk> (raw)
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
next reply other threads:[~2007-11-09 1:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-09 1:12 Jonas Fonseca [this message]
2007-11-09 1:39 ` [BUG] git-rebase fails when a commit message contains a diff 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071109011214.GA5903@diku.dk \
--to=fonseca@diku.dk \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.