{"thread":{"id":"47792","subject":"[PATCH] rebase -p: fix incorrect commit message when calling `git merge`.","startedAt":"2018-02-08T20:43:40Z","lastAt":"2018-02-09T17:28:19Z","messageCount":3,"participants":["gregory.herrero@oracle.com","Junio C Hamano","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"338773","messageId":"20180208204241.19324-1-gregory.herrero@oracle.com","threadId":"47792","inReplyTo":null,"subject":"[PATCH] rebase -p: fix incorrect commit message when calling `git merge`.","fromName":"","fromEmail":"gregory.herrero@oracle.com","sentAt":"2018-02-08T20:42:41Z","receivedAt":"2018-02-08T20:43:40Z","isPatch":true,"sender":{"key":"gregory.herrero@oracle.com","avatar":null},"body":"From: Gregory Herrero <gregory.herrero@oracle.com>\n\nSince commit dd6fb0053 (\"rebase -p: fix quoting when calling `git\nmerge`\"), commit message of the merge commit being rebased is passed to\nthe merge command using a subshell executing 'git rev-parse --sq-quote'.\n\nDouble quotes are needed around this subshell so that, newlines are\nkept for the git merge command.\n\nBefore this patch, following merge message:\n\n    \"Merge mybranch into mynewbranch\n\n    Awesome commit.\"\n\nbecomes:\n\n    \"Merge mybranch into mynewbranch Awesome commit.\"\n\nafter a rebase -p.\n\nFixes: \"dd6fb0053 rebase -p: fix quoting when calling `git merge`\"\nReported-by: Jamie Iles <jamie.iles@oracle.com>\nSuggested-by: Vegard Nossum <vegard.nossum@oracle.com>\nSuggested-by: Quentin Casasnovas <quentin.casasnovas@oracle.com>\nSigned-off-by: Gregory Herrero <gregory.herrero@oracle.com>\n---\n git-rebase--interactive.sh   |  2 +-\n t/t3408-rebase-multi-line.sh | 26 +++++++++++++++++++++++++-\n 2 files changed, 26 insertions(+), 2 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex d47bd2959..ab6a5883e 100644\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -396,7 +396,7 @@ pick_one_preserving_merges () {\n \t\t\t\t\t--sq-quote \"$gpg_sign_opt\")} \\\n \t\t\t\t$allow_rerere_autoupdate \"$merge_args\" \\\n \t\t\t\t\"$strategy_args\" \\\n-\t\t\t\t-m $(git rev-parse --sq-quote \"$msg_content\") \\\n+\t\t\t\t-m \"$(git rev-parse --sq-quote \"$msg_content\")\" \\\n \t\t\t\t\"$new_parents\"\n \t\t\tthen\n \t\t\t\tprintf \"%s\\n\" \"$msg_content\" > \"$GIT_DIR\"/MERGE_MSG\ndiff --git a/t/t3408-rebase-multi-line.sh b/t/t3408-rebase-multi-line.sh\nindex 6b84e6042..e217fb4fb 100755\n--- a/t/t3408-rebase-multi-line.sh\n+++ b/t/t3408-rebase-multi-line.sh\n@@ -24,8 +24,23 @@ But otherwise with a sane description.\" &&\n \t>elif &&\n \tgit add elif &&\n \ttest_tick &&\n-\tgit commit -m second\n+\tgit commit -m second &&\n \n+\tgit checkout -b side2 &&\n+\t>afile &&\n+\tgit add afile &&\n+\ttest_tick &&\n+\tgit commit -m third &&\n+\techo hello > afile &&\n+\ttest_tick &&\n+\tgit commit -a -m fourth &&\n+\tgit checkout -b side-merge &&\n+\tgit reset --hard HEAD^^ &&\n+\tgit merge --no-ff -m \"A merge commit log message that has a long\n+summary that spills over multiple lines.\n+\n+But otherwise with a sane description.\" side2 &&\n+\tgit branch side-merge-original\n '\n \n test_expect_success rebase '\n@@ -36,6 +51,15 @@ test_expect_success rebase '\n \tgit cat-file commit side@{1} | sed -e \"1,/^\\$/d\" >expect &&\n \ttest_cmp expect actual\n \n+'\n+test_expect_success rebasep '\n+\n+\tgit checkout side-merge &&\n+\tgit rebase -p side &&\n+\tgit cat-file commit HEAD | sed -e \"1,/^\\$/d\" >actual &&\n+\tgit cat-file commit side-merge-original | sed -e \"1,/^\\$/d\" >expect &&\n+\ttest_cmp expect actual\n+\n '\n \n test_done\n-- \n2.16.1\n\n"},{"id":"338790","messageId":"xmqqd11f6rk5.fsf@gitster-ct.c.googlers.com","threadId":"47792","inReplyTo":"20180208204241.19324-1-gregory.herrero@oracle.com","subject":"Re: [PATCH] rebase -p: fix incorrect commit message when calling `git merge`.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-02-08T22:32:26Z","receivedAt":"2018-02-08T22:32:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"gregory.herrero@oracle.com writes:\n\n> Since commit dd6fb0053 (\"rebase -p: fix quoting when calling `git\n> merge`\"), commit message of the merge commit being rebased is passed to\n> the merge command using a subshell executing 'git rev-parse --sq-quote'.\n>\n> Double quotes are needed around this subshell so that, newlines are\n> kept for the git merge command.\n\nThanks for a fix.  Queued.\n\n"},{"id":"338884","messageId":"nycvar.QRO.7.76.6.1802091827470.35@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz","threadId":"47792","inReplyTo":"20180208204241.19324-1-gregory.herrero@oracle.com","subject":"Re: [PATCH] rebase -p: fix incorrect commit message when calling `git merge`.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2018-02-09T17:28:09Z","receivedAt":"2018-02-09T17:28:19Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 8 Feb 2018, gregory.herrero@oracle.com wrote:\n\n> From: Gregory Herrero <gregory.herrero@oracle.com>\n> \n> Since commit dd6fb0053 (\"rebase -p: fix quoting when calling `git\n> merge`\"), commit message of the merge commit being rebased is passed to\n> the merge command using a subshell executing 'git rev-parse --sq-quote'.\n\nThanks for fixing my incomplete fix.\n\nCiao,\nJohannes\n"}]}