{"thread":{"id":"34741","subject":"[PATCH] rebase --preserve-merges: ignore \"merge.log\" config","startedAt":"2013-08-21T18:48:57Z","lastAt":"2013-08-21T22:44:40Z","messageCount":3,"participants":["Ralf Thielow","Eric Sunshine","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"225625","messageId":"1377110937-13439-1-git-send-email-ralf.thielow@gmail.com","threadId":"34741","inReplyTo":null,"subject":"[PATCH] rebase --preserve-merges: ignore \"merge.log\" config","fromName":"Ralf Thielow","fromEmail":"ralf.thielow@gmail.com","sentAt":"2013-08-21T18:48:57Z","receivedAt":"2013-08-21T18:48:57Z","isPatch":true,"sender":{"key":"ralf.thielow@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1275832?v=4"},"body":"When \"merge.log\" config is set, \"rebase --preserve-merges\"\nwill add the log lines to the message of the rebased merge\ncommit.\n\nA rebase should not modify a commit message automatically.\n\nTeach \"git-rebase\" to ignore that configuration by passing \"--no-log\"\nto the git-merge call.\n\nSigned-off-by: Ralf Thielow <ralf.thielow@gmail.com>\n---\n git-rebase--interactive.sh        |  3 ++-\n t/t3409-rebase-preserve-merges.sh | 25 +++++++++++++++++++++++++\n 2 files changed, 27 insertions(+), 1 deletion(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 83d6d46..4743c59 100644\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -352,8 +352,9 @@ pick_one_preserving_merges () {\n \t\t\tmsg_content=\"$(commit_message $sha1)\"\n \t\t\t# No point in merging the first parent, that's HEAD\n \t\t\tnew_parents=${new_parents# $first_parent}\n+\t\t\tmerge_args=\"--no-log --no-ff\"\n \t\t\tif ! do_with_author output eval \\\n-\t\t\t'git merge --no-ff $strategy_args -m \"$msg_content\" $new_parents'\n+\t\t\t'git merge $merge_args $strategy_args -m \"$msg_content\" $new_parents'\n \t\t\tthen\n \t\t\t\tprintf \"%s\\n\" \"$msg_content\" > \"$GIT_DIR\"/MERGE_MSG\n \t\t\t\tdie_with_patch $sha1 \"Error redoing merge $sha1\"\ndiff --git a/t/t3409-rebase-preserve-merges.sh b/t/t3409-rebase-preserve-merges.sh\nindex 2e0c364..2454811 100755\n--- a/t/t3409-rebase-preserve-merges.sh\n+++ b/t/t3409-rebase-preserve-merges.sh\n@@ -28,6 +28,8 @@ export GIT_AUTHOR_EMAIL\n #     \\--A3    <-- topic2\n #      \\\n #       B2     <-- origin/topic\n+#\n+# Clone 4 (same as Clone 3)\n \n test_expect_success 'setup for merge-preserving rebase' \\\n \t'echo First > A &&\n@@ -64,6 +66,16 @@ test_expect_success 'setup for merge-preserving rebase' \\\n \t\tgit merge --no-ff topic2\n \t) &&\n \n+\tgit clone ./. clone4 &&\n+\t(\n+\t\tcd clone4 &&\n+\t\tgit checkout -b topic2 origin/topic &&\n+\t\techo Sixth > A &&\n+\t\tgit commit -a -m \"Modify A3\" &&\n+\t\tgit checkout -b topic origin/topic &&\n+\t\tgit merge --no-ff topic2\n+\t) &&\n+\n \tgit checkout topic &&\n \techo Fourth >> B &&\n \tgit commit -a -m \"Modify B2\"\n@@ -96,4 +108,17 @@ test_expect_success 'rebase -p preserves no-ff merges' '\n \t)\n '\n \n+test_expect_success 'rebase -p ignores merge.log config' '\n+\t(\n+\tcd clone4 &&\n+\tgit fetch &&\n+\tgit -c merge.log=1 rebase -p origin/topic &&\n+\tcat >expected <<-\\EOF &&\n+\n+\tEOF\n+\tgit log --format=\"%b\" -1 >current\n+\ttest_cmp expected current\n+\t)\n+'\n+\n test_done\n-- \n1.8.4.rc4.dirty\n"},{"id":"225636","messageId":"CAPig+cTWgaMLLUBEetAQnNG2U34d8YgYPSSNds4oFim4uB=2WA@mail.gmail.com","threadId":"34741","inReplyTo":"1377110937-13439-1-git-send-email-ralf.thielow@gmail.com","subject":"Re: [PATCH] rebase --preserve-merges: ignore \"merge.log\" config","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-08-21T20:22:27Z","receivedAt":"2013-08-21T20:22:27Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, Aug 21, 2013 at 2:48 PM, Ralf Thielow <ralf.thielow@gmail.com> wrote:\n> When \"merge.log\" config is set, \"rebase --preserve-merges\"\n> will add the log lines to the message of the rebased merge\n> commit.\n>\n> A rebase should not modify a commit message automatically.\n>\n> Teach \"git-rebase\" to ignore that configuration by passing \"--no-log\"\n> to the git-merge call.\n>\n> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>\n> ---\n> diff --git a/t/t3409-rebase-preserve-merges.sh b/t/t3409-rebase-preserve-merges.sh\n> index 2e0c364..2454811 100755\n> --- a/t/t3409-rebase-preserve-merges.sh\n> +++ b/t/t3409-rebase-preserve-merges.sh\n> @@ -96,4 +108,17 @@ test_expect_success 'rebase -p preserves no-ff merges' '\n>         )\n>  '\n>\n> +test_expect_success 'rebase -p ignores merge.log config' '\n> +       (\n> +       cd clone4 &&\n> +       git fetch &&\n> +       git -c merge.log=1 rebase -p origin/topic &&\n> +       cat >expected <<-\\EOF &&\n> +\n> +       EOF\n\nThis might be clearer with a simple 'echo' instead of 'cat' with heredoc:\n\n  echo >expected &&\n\n> +       git log --format=\"%b\" -1 >current\n> +       test_cmp expected current\n> +       )\n> +'\n> +\n>  test_done\n> --\n> 1.8.4.rc4.dirty\n"},{"id":"225657","messageId":"xmqqwqneslyf.fsf@gitster.dls.corp.google.com","threadId":"34741","inReplyTo":"1377110937-13439-1-git-send-email-ralf.thielow@gmail.com","subject":"Re: [PATCH] rebase --preserve-merges: ignore \"merge.log\" config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-08-21T22:44:40Z","receivedAt":"2013-08-21T22:44:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ralf Thielow <ralf.thielow@gmail.com> writes:\n\n> When \"merge.log\" config is set, \"rebase --preserve-merges\"\n> will add the log lines to the message of the rebased merge\n> commit.\n>\n> A rebase should not modify a commit message automatically.\n>\n> Teach \"git-rebase\" to ignore that configuration by passing \"--no-log\"\n> to the git-merge call.\n>\n> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>\n> ---\n\nThanks; will queue with the following squashed-in.\n\n t/t3409-rebase-preserve-merges.sh | 6 ++----\n 1 file changed, 2 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t3409-rebase-preserve-merges.sh b/t/t3409-rebase-preserve-merges.sh\nindex 2454811..8c251c5 100755\n--- a/t/t3409-rebase-preserve-merges.sh\n+++ b/t/t3409-rebase-preserve-merges.sh\n@@ -113,10 +113,8 @@ test_expect_success 'rebase -p ignores merge.log config' '\n \tcd clone4 &&\n \tgit fetch &&\n \tgit -c merge.log=1 rebase -p origin/topic &&\n-\tcat >expected <<-\\EOF &&\n-\n-\tEOF\n-\tgit log --format=\"%b\" -1 >current\n+\techo >expected &&\n+\tgit log --format=\"%b\" -1 >current &&\n \ttest_cmp expected current\n \t)\n '\n"}]}