{"thread":{"id":"24055","subject":"[PATCH] Add a test for \"git rebase\" with a From_ line in the commit message","startedAt":"2010-06-09T17:29:17Z","lastAt":"2010-06-09T17:29:17Z","messageCount":1,"participants":["Carl Worth"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"143363","messageId":"1276104557-2025-1-git-send-email-cworth@cworth.org","threadId":"24055","inReplyTo":null,"subject":"[PATCH] Add a test for \"git rebase\" with a From_ line in the commit message","fromName":"Carl Worth","fromEmail":"cworth@cworth.org","sentAt":"2010-06-09T17:29:17Z","receivedAt":"2010-06-09T17:29:17Z","isPatch":true,"sender":{"key":"cworth@cworth.org","avatar":"https://gravatar.com/avatar/3746dc28cde609bdbd7f939058356e7e2bbd16d21e32274df0725eb3d998bc5b?d=mp&s=160"},"body":"This test ensures that all tools underlying \"git rebase\", (such as\n\"git format-patch\" and \"git am\"), collectively agree on a robust\nescaping mechanism for a line in the commit message that looks like\nan mbox separator.\n\nSpecifically, the problematic line begins with \"From \" and ends with a\ntimestamp in the form returned by the asctime function.\n\nSigned-off-by: Carl Worth <cworth@cworth.org>\n---\n\nThis test fails with git from origin/master but passes with my current\nseries of patches to implement mboxrd format in both format-patch and\nmailsplit. This would also be a useful test even if some other robust\nformat were chosen other than mboxrd.\n\n t/t3418-rebase-From_.sh |   38 ++++++++++++++++++++++++++++++++++++++\n 1 files changed, 38 insertions(+), 0 deletions(-)\n create mode 100755 t/t3418-rebase-From_.sh\n\ndiff --git a/t/t3418-rebase-From_.sh b/t/t3418-rebase-From_.sh\nnew file mode 100755\nindex 0000000..c809fda\n--- /dev/null\n+++ b/t/t3418-rebase-From_.sh\n@@ -0,0 +1,38 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2010 Carl Worth\n+#\n+\n+test_description='git rebase with a commit with a From_ line in it\n+\n+This test ensures that git rebase will not get confused by a commit\n+that contains a line in the commit message that looks like a mbox\n+separator (begins with \"From \" and ends with an asctime-like timestamp)\n+'\n+. ./test-lib.sh\n+\n+cat >msg <<EOF\n+From_-line commit\n+\n+This crafty commit message contains a line that looks an awful lot\n+like an mbox separator. This kind of thing has been known to happen,\n+(often accidentally), but git rebase should still support it.\n+\n+Here's the tricky line:\n+\n+From 74df72aec0b959c3015f4d7f213453217cb21aed Mon Sep 17 00:00:00 2001\n+\n+EOF\n+test_expect_success 'setup' '\n+\ttest_commit A &&\n+\ttest_commit B &&\n+\techo \"hello world\" > file &&\n+\tgit add file &&\n+\tgit commit -F msg\n+'\n+\n+test_expect_success 'git rebase replaying a commit with a From_ line' '\n+\tgit rebase --onto A B\n+'\n+\n+test_done\n-- \n1.7.1.249.g74df7\n"}]}