{"thread":{"id":"53990","subject":"[PATCH] sequencer: avoid garbled merge machinery messages due to commit labels","startedAt":"2020-08-05T19:06:46Z","lastAt":"2020-08-14T12:13:02Z","messageCount":5,"participants":["Elijah Newren via GitGitGadget","Taylor Blau","Junio C Hamano","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"402936","messageId":"pull.828.git.git.1596654345718.gitgitgadget@gmail.com","threadId":"53990","inReplyTo":null,"subject":"[PATCH] sequencer: avoid garbled merge machinery messages due to commit labels","fromName":"Elijah Newren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-08-05T19:05:45Z","receivedAt":"2020-08-05T19:06:46Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"From: Elijah Newren <newren@gmail.com>\n\nsequencer's get_message() exists to provide good labels on conflict\nhunks; see commits\n  d68565402a (\"revert: clarify label on conflict hunks\", 2010-03-20)\n  bf975d379d (\"cherry-pick, revert: add a label for ancestor\", 2010-03-20)\n  043a4492b3 (\"sequencer: factor code out of revert builtin\", 2012-01-11).\nfor background on this function.  These labels are of the form\n  <commitID>... <commit summary>\nor\n  parent of <commitID>... <commit summary>\nThese labels are then passed as branch names to the merge machinery.\nHowever, these labels, as formatted, often also serve to confuse.  For\nexample, if we have a rename involved in a content merge, then it\nresults in text such as the following:\n\n    <<<<<<<< HEAD:foo.c\n      int j;\n    ========\n      int counter;\n    >>>>>>>> b01dface... Removed unnecessary stuff:bar.c\n\nOr in various conflict messages, it can make it very difficult to read:\n\n    CONFLICT (rename/delete): foo.c deleted in b01dface... Removed\n    unnecessary stuff and renamed in HEAD.  Version HEAD of foo.c left\n    in tree.\n\n    CONFLICT (file location): dir1/foo.c added in b01dface... Removed\n    unnecessary stuff inside a directory that was renamed in HEAD,\n    suggesting it should perhaps be moved to dir2/foo.c.\n\nMake a minor change to remove the ellipses and add parentheses around\nthe commit summary; this makes all three examples much easier to read:\n\n    <<<<<<<< HEAD:foo.c\n      int j;\n    ========\n      int counter;\n    >>>>>>>> b01dface (Removed unnecessary stuff):bar.c\n\n    CONFLICT (rename/delete): foo.c deleted in b01dface (Removed\n    unnecessary stuff) and renamed in HEAD.  Version HEAD of foo.c left\n    in tree.\n\n    CONFLICT (file location): dir1/foo.c added in b01dface (Removed\n    unnecessary stuff) inside a directory that was renamed in HEAD,\n    suggesting it should perhaps be moved to dir2/foo.c.\n\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n    sequencer: avoid garbled merge machinery messages due to commit labels\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-828%2Fnewren%2Fsequencer-merge-messages-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-828/newren/sequencer-merge-messages-v1\nPull-Request: https://github.com/git/git/pull/828\n\n sequencer.c                     |  2 +-\n t/t3404-rebase-interactive.sh   |  2 +-\n t/t3507-cherry-pick-conflict.sh | 20 ++++++++++----------\n 3 files changed, 12 insertions(+), 12 deletions(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex fd7701c88a..e988c12ad2 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -355,7 +355,7 @@ static int get_message(struct commit *commit, struct commit_message *out)\n \tsubject_len = find_commit_subject(out->message, &subject);\n \n \tout->subject = xmemdupz(subject, subject_len);\n-\tout->label = xstrfmt(\"%s... %s\", abbrev, out->subject);\n+\tout->label = xstrfmt(\"%s (%s)\", abbrev, out->subject);\n \tout->parent_label = xstrfmt(\"parent of %s\", out->label);\n \n \treturn 0;\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 4a7d21f898..1d0a656ebd 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -256,7 +256,7 @@ test_expect_success 'stop on conflicting pick' '\n \tD\n \t=======\n \tG\n-\t>>>>>>> $commit... G\n+\t>>>>>>> $commit (G)\n \tEOF\n \tgit tag new-branch1 &&\n \ttest_must_fail git rebase -i master &&\ndiff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh\nindex 752bc43487..152ea11dc9 100755\n--- a/t/t3507-cherry-pick-conflict.sh\n+++ b/t/t3507-cherry-pick-conflict.sh\n@@ -283,12 +283,12 @@ test_expect_success 'failed cherry-pick describes conflict in work tree' '\n \ta\n \t=======\n \tc\n-\t>>>>>>> objid picked\n+\t>>>>>>> objid (picked)\n \tEOF\n \n \ttest_must_fail git cherry-pick picked &&\n \n-\tsed \"s/[a-f0-9]*\\.\\.\\./objid/\" foo >actual &&\n+\tsed \"s/[a-f0-9]* (/objid (/\" foo >actual &&\n \ttest_cmp expected actual\n '\n \n@@ -298,16 +298,16 @@ test_expect_success 'diff3 -m style' '\n \tcat <<-EOF >expected &&\n \t<<<<<<< HEAD\n \ta\n-\t||||||| parent of objid picked\n+\t||||||| parent of objid (picked)\n \tb\n \t=======\n \tc\n-\t>>>>>>> objid picked\n+\t>>>>>>> objid (picked)\n \tEOF\n \n \ttest_must_fail git cherry-pick picked &&\n \n-\tsed \"s/[a-f0-9]*\\.\\.\\./objid/\" foo >actual &&\n+\tsed \"s/[a-f0-9]* (/objid (/\" foo >actual &&\n \ttest_cmp expected actual\n '\n \n@@ -319,7 +319,7 @@ test_expect_success 'revert also handles conflicts sanely' '\n \ta\n \t=======\n \tb\n-\t>>>>>>> parent of objid picked\n+\t>>>>>>> parent of objid (picked)\n \tEOF\n \t{\n \t\tgit checkout picked -- foo &&\n@@ -345,7 +345,7 @@ test_expect_success 'revert also handles conflicts sanely' '\n \ttest_must_fail git update-index --refresh -q &&\n \ttest_must_fail git diff-index --exit-code HEAD &&\n \ttest_cmp expected-stages actual-stages &&\n-\tsed \"s/[a-f0-9]*\\.\\.\\./objid/\" foo >actual &&\n+\tsed \"s/[a-f0-9]* (/objid (/\" foo >actual &&\n \ttest_cmp expected actual\n '\n \n@@ -429,16 +429,16 @@ test_expect_success 'revert conflict, diff3 -m style' '\n \tcat <<-EOF >expected &&\n \t<<<<<<< HEAD\n \ta\n-\t||||||| objid picked\n+\t||||||| objid (picked)\n \tc\n \t=======\n \tb\n-\t>>>>>>> parent of objid picked\n+\t>>>>>>> parent of objid (picked)\n \tEOF\n \n \ttest_must_fail git revert picked &&\n \n-\tsed \"s/[a-f0-9]*\\.\\.\\./objid/\" foo >actual &&\n+\tsed \"s/[a-f0-9]* (/objid (/\" foo >actual &&\n \ttest_cmp expected actual\n '\n \n\nbase-commit: dc04167d378fb29d30e1647ff6ff51dd182bc9a3\n-- \ngitgitgadget\n"},{"id":"402972","messageId":"20200805212032.GK9546@syl.lan","threadId":"53990","inReplyTo":"pull.828.git.git.1596654345718.gitgitgadget@gmail.com","subject":"Re: [PATCH] sequencer: avoid garbled merge machinery messages due to commit labels","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2020-08-05T21:20:32Z","receivedAt":"2020-08-05T21:20:40Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Wed, Aug 05, 2020 at 07:05:45PM +0000, Elijah Newren via GitGitGadget wrote:\n> From: Elijah Newren <newren@gmail.com>\n>\n> sequencer's get_message() exists to provide good labels on conflict\n> hunks; see commits\n>   d68565402a (\"revert: clarify label on conflict hunks\", 2010-03-20)\n>   bf975d379d (\"cherry-pick, revert: add a label for ancestor\", 2010-03-20)\n>   043a4492b3 (\"sequencer: factor code out of revert builtin\", 2012-01-11).\n> for background on this function.  These labels are of the form\n>   <commitID>... <commit summary>\n> or\n>   parent of <commitID>... <commit summary>\n> These labels are then passed as branch names to the merge machinery.\n> However, these labels, as formatted, often also serve to confuse.  For\n> example, if we have a rename involved in a content merge, then it\n> results in text such as the following:\n>\n>     <<<<<<<< HEAD:foo.c\n>       int j;\n>     ========\n>       int counter;\n>     >>>>>>>> b01dface... Removed unnecessary stuff:bar.c\n>\n> Or in various conflict messages, it can make it very difficult to read:\n>\n>     CONFLICT (rename/delete): foo.c deleted in b01dface... Removed\n>     unnecessary stuff and renamed in HEAD.  Version HEAD of foo.c left\n>     in tree.\n>\n>     CONFLICT (file location): dir1/foo.c added in b01dface... Removed\n>     unnecessary stuff inside a directory that was renamed in HEAD,\n>     suggesting it should perhaps be moved to dir2/foo.c.\n>\n> Make a minor change to remove the ellipses and add parentheses around\n> the commit summary; this makes all three examples much easier to read:\n>\n>     <<<<<<<< HEAD:foo.c\n>       int j;\n>     ========\n>       int counter;\n>     >>>>>>>> b01dface (Removed unnecessary stuff):bar.c\n>\n>     CONFLICT (rename/delete): foo.c deleted in b01dface (Removed\n>     unnecessary stuff) and renamed in HEAD.  Version HEAD of foo.c left\n>     in tree.\n>\n>     CONFLICT (file location): dir1/foo.c added in b01dface (Removed\n>     unnecessary stuff) inside a directory that was renamed in HEAD,\n>     suggesting it should perhaps be moved to dir2/foo.c.\n>\n> Signed-off-by: Elijah Newren <newren@gmail.com>\n\nThis is much easier to read, and the change below is obviously correct.\nThanks for working to improve the readability of these markers.\n\n  Reviewed-by: Taylor Blau <me@ttaylorr.com>\n\n> ---\n>     sequencer: avoid garbled merge machinery messages due to commit labels\n>\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-828%2Fnewren%2Fsequencer-merge-messages-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-828/newren/sequencer-merge-messages-v1\n> Pull-Request: https://github.com/git/git/pull/828\n>\n>  sequencer.c                     |  2 +-\n>  t/t3404-rebase-interactive.sh   |  2 +-\n>  t/t3507-cherry-pick-conflict.sh | 20 ++++++++++----------\n>  3 files changed, 12 insertions(+), 12 deletions(-)\n>\n> diff --git a/sequencer.c b/sequencer.c\n> index fd7701c88a..e988c12ad2 100644\n> --- a/sequencer.c\n> +++ b/sequencer.c\n> @@ -355,7 +355,7 @@ static int get_message(struct commit *commit, struct commit_message *out)\n>  \tsubject_len = find_commit_subject(out->message, &subject);\n>\n>  \tout->subject = xmemdupz(subject, subject_len);\n> -\tout->label = xstrfmt(\"%s... %s\", abbrev, out->subject);\n> +\tout->label = xstrfmt(\"%s (%s)\", abbrev, out->subject);\n>  \tout->parent_label = xstrfmt(\"parent of %s\", out->label);\n>\n>  \treturn 0;\n> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\n> index 4a7d21f898..1d0a656ebd 100755\n> --- a/t/t3404-rebase-interactive.sh\n> +++ b/t/t3404-rebase-interactive.sh\n> @@ -256,7 +256,7 @@ test_expect_success 'stop on conflicting pick' '\n>  \tD\n>  \t=======\n>  \tG\n> -\t>>>>>>> $commit... G\n> +\t>>>>>>> $commit (G)\n>  \tEOF\n>  \tgit tag new-branch1 &&\n>  \ttest_must_fail git rebase -i master &&\n> diff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh\n> index 752bc43487..152ea11dc9 100755\n> --- a/t/t3507-cherry-pick-conflict.sh\n> +++ b/t/t3507-cherry-pick-conflict.sh\n> @@ -283,12 +283,12 @@ test_expect_success 'failed cherry-pick describes conflict in work tree' '\n>  \ta\n>  \t=======\n>  \tc\n> -\t>>>>>>> objid picked\n> +\t>>>>>>> objid (picked)\n>  \tEOF\n>\n>  \ttest_must_fail git cherry-pick picked &&\n>\n> -\tsed \"s/[a-f0-9]*\\.\\.\\./objid/\" foo >actual &&\n> +\tsed \"s/[a-f0-9]* (/objid (/\" foo >actual &&\n>  \ttest_cmp expected actual\n>  '\n>\n> @@ -298,16 +298,16 @@ test_expect_success 'diff3 -m style' '\n>  \tcat <<-EOF >expected &&\n>  \t<<<<<<< HEAD\n>  \ta\n> -\t||||||| parent of objid picked\n> +\t||||||| parent of objid (picked)\n>  \tb\n>  \t=======\n>  \tc\n> -\t>>>>>>> objid picked\n> +\t>>>>>>> objid (picked)\n>  \tEOF\n>\n>  \ttest_must_fail git cherry-pick picked &&\n>\n> -\tsed \"s/[a-f0-9]*\\.\\.\\./objid/\" foo >actual &&\n> +\tsed \"s/[a-f0-9]* (/objid (/\" foo >actual &&\n>  \ttest_cmp expected actual\n>  '\n>\n> @@ -319,7 +319,7 @@ test_expect_success 'revert also handles conflicts sanely' '\n>  \ta\n>  \t=======\n>  \tb\n> -\t>>>>>>> parent of objid picked\n> +\t>>>>>>> parent of objid (picked)\n>  \tEOF\n>  \t{\n>  \t\tgit checkout picked -- foo &&\n> @@ -345,7 +345,7 @@ test_expect_success 'revert also handles conflicts sanely' '\n>  \ttest_must_fail git update-index --refresh -q &&\n>  \ttest_must_fail git diff-index --exit-code HEAD &&\n>  \ttest_cmp expected-stages actual-stages &&\n> -\tsed \"s/[a-f0-9]*\\.\\.\\./objid/\" foo >actual &&\n> +\tsed \"s/[a-f0-9]* (/objid (/\" foo >actual &&\n>  \ttest_cmp expected actual\n>  '\n>\n> @@ -429,16 +429,16 @@ test_expect_success 'revert conflict, diff3 -m style' '\n>  \tcat <<-EOF >expected &&\n>  \t<<<<<<< HEAD\n>  \ta\n> -\t||||||| objid picked\n> +\t||||||| objid (picked)\n>  \tc\n>  \t=======\n>  \tb\n> -\t>>>>>>> parent of objid picked\n> +\t>>>>>>> parent of objid (picked)\n>  \tEOF\n>\n>  \ttest_must_fail git revert picked &&\n>\n> -\tsed \"s/[a-f0-9]*\\.\\.\\./objid/\" foo >actual &&\n> +\tsed \"s/[a-f0-9]* (/objid (/\" foo >actual &&\n>  \ttest_cmp expected actual\n>  '\n>\n>\n> base-commit: dc04167d378fb29d30e1647ff6ff51dd182bc9a3\n> --\n> gitgitgadget\nThanks,\nTaylor\n"},{"id":"402999","messageId":"xmqq8sesn2zc.fsf@gitster.c.googlers.com","threadId":"53990","inReplyTo":"20200805212032.GK9546@syl.lan","subject":"Re: [PATCH] sequencer: avoid garbled merge machinery messages due to commit labels","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-08-05T22:26:47Z","receivedAt":"2020-08-05T22:26:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Taylor Blau <me@ttaylorr.com> writes:\n\n>> ...\n>>     <<<<<<<< HEAD:foo.c\n>>       int j;\n>>     ========\n>>       int counter;\n>>     >>>>>>>> b01dface (Removed unnecessary stuff):bar.c\n>>\n>>     CONFLICT (rename/delete): foo.c deleted in b01dface (Removed\n>>     unnecessary stuff) and renamed in HEAD.  Version HEAD of foo.c left\n>>     in tree.\n>>\n>>     CONFLICT (file location): dir1/foo.c added in b01dface (Removed\n>>     unnecessary stuff) inside a directory that was renamed in HEAD,\n>>     suggesting it should perhaps be moved to dir2/foo.c.\n>>\n>> Signed-off-by: Elijah Newren <newren@gmail.com>\n>\n> This is much easier to read, and the change below is obviously correct.\n> Thanks for working to improve the readability of these markers.\n>\n>   Reviewed-by: Taylor Blau <me@ttaylorr.com>\n\nThanks.  Looks good.\n"},{"id":"403457","messageId":"pull.828.v2.git.git.1597243205137.gitgitgadget@gmail.com","threadId":"53990","inReplyTo":"pull.828.git.git.1596654345718.gitgitgadget@gmail.com","subject":"[PATCH v2] sequencer: avoid garbled merge machinery messages due to commit labels","fromName":"Elijah Newren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2020-08-12T14:40:04Z","receivedAt":"2020-08-12T14:40:13Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"From: Elijah Newren <newren@gmail.com>\n\nsequencer's get_message() exists to provide good labels on conflict\nhunks; see commits\n  d68565402a (\"revert: clarify label on conflict hunks\", 2010-03-20)\n  bf975d379d (\"cherry-pick, revert: add a label for ancestor\", 2010-03-20)\n  043a4492b3 (\"sequencer: factor code out of revert builtin\", 2012-01-11).\nfor background on this function.  These labels are of the form\n  <commitID>... <commit summary>\nor\n  parent of <commitID>... <commit summary>\nThese labels are then passed as branch names to the merge machinery.\nHowever, these labels, as formatted, often also serve to confuse.  For\nexample, if we have a rename involved in a content merge, then it\nresults in text such as the following:\n\n    <<<<<<<< HEAD:foo.c\n      int j;\n    ========\n      int counter;\n    >>>>>>>> b01dface... Removed unnecessary stuff:bar.c\n\nOr in various conflict messages, it can make it very difficult to read:\n\n    CONFLICT (rename/delete): foo.c deleted in b01dface... Removed\n    unnecessary stuff and renamed in HEAD.  Version HEAD of foo.c left\n    in tree.\n\n    CONFLICT (file location): dir1/foo.c added in b01dface... Removed\n    unnecessary stuff inside a directory that was renamed in HEAD,\n    suggesting it should perhaps be moved to dir2/foo.c.\n\nMake a minor change to remove the ellipses and add parentheses around\nthe commit summary; this makes all three examples much easier to read:\n\n    <<<<<<<< HEAD:foo.c\n      int j;\n    ========\n      int counter;\n    >>>>>>>> b01dface (Removed unnecessary stuff):bar.c\n\n    CONFLICT (rename/delete): foo.c deleted in b01dface (Removed\n    unnecessary stuff) and renamed in HEAD.  Version HEAD of foo.c left\n    in tree.\n\n    CONFLICT (file location): dir1/foo.c added in b01dface (Removed\n    unnecessary stuff) inside a directory that was renamed in HEAD,\n    suggesting it should perhaps be moved to dir2/foo.c.\n\nSigned-off-by: Elijah Newren <newren@gmail.com>\nReviewed-by: Taylor Blau <me@ttaylorr.com>\nAcked-by: Junio C Hamano <gitster@pobox.com>\n---\n    sequencer: avoid garbled merge machinery messages due to commit labels\n    \n    Changes since v1:\n    \n     * Added Taylor's Reviewed-by, and Junio's Acked-by (I assume that's a\n       fair translation of \"Looks good\", anyway; feel free to adjust when\n       you apply otherwise).\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-828%2Fnewren%2Fsequencer-merge-messages-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-828/newren/sequencer-merge-messages-v2\nPull-Request: https://github.com/git/git/pull/828\n\nRange-diff vs v1:\n\n 1:  da49e2eb58 ! 1:  762eb962cc sequencer: avoid garbled merge machinery messages due to commit labels\n     @@ Commit message\n              suggesting it should perhaps be moved to dir2/foo.c.\n      \n          Signed-off-by: Elijah Newren <newren@gmail.com>\n     +    Reviewed-by: Taylor Blau <me@ttaylorr.com>\n     +    Acked-by: Junio C Hamano <gitster@pobox.com>\n      \n       ## sequencer.c ##\n      @@ sequencer.c: static int get_message(struct commit *commit, struct commit_message *out)\n\n\n sequencer.c                     |  2 +-\n t/t3404-rebase-interactive.sh   |  2 +-\n t/t3507-cherry-pick-conflict.sh | 20 ++++++++++----------\n 3 files changed, 12 insertions(+), 12 deletions(-)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex fd7701c88a..e988c12ad2 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -355,7 +355,7 @@ static int get_message(struct commit *commit, struct commit_message *out)\n \tsubject_len = find_commit_subject(out->message, &subject);\n \n \tout->subject = xmemdupz(subject, subject_len);\n-\tout->label = xstrfmt(\"%s... %s\", abbrev, out->subject);\n+\tout->label = xstrfmt(\"%s (%s)\", abbrev, out->subject);\n \tout->parent_label = xstrfmt(\"parent of %s\", out->label);\n \n \treturn 0;\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 4a7d21f898..1d0a656ebd 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -256,7 +256,7 @@ test_expect_success 'stop on conflicting pick' '\n \tD\n \t=======\n \tG\n-\t>>>>>>> $commit... G\n+\t>>>>>>> $commit (G)\n \tEOF\n \tgit tag new-branch1 &&\n \ttest_must_fail git rebase -i master &&\ndiff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh\nindex 752bc43487..152ea11dc9 100755\n--- a/t/t3507-cherry-pick-conflict.sh\n+++ b/t/t3507-cherry-pick-conflict.sh\n@@ -283,12 +283,12 @@ test_expect_success 'failed cherry-pick describes conflict in work tree' '\n \ta\n \t=======\n \tc\n-\t>>>>>>> objid picked\n+\t>>>>>>> objid (picked)\n \tEOF\n \n \ttest_must_fail git cherry-pick picked &&\n \n-\tsed \"s/[a-f0-9]*\\.\\.\\./objid/\" foo >actual &&\n+\tsed \"s/[a-f0-9]* (/objid (/\" foo >actual &&\n \ttest_cmp expected actual\n '\n \n@@ -298,16 +298,16 @@ test_expect_success 'diff3 -m style' '\n \tcat <<-EOF >expected &&\n \t<<<<<<< HEAD\n \ta\n-\t||||||| parent of objid picked\n+\t||||||| parent of objid (picked)\n \tb\n \t=======\n \tc\n-\t>>>>>>> objid picked\n+\t>>>>>>> objid (picked)\n \tEOF\n \n \ttest_must_fail git cherry-pick picked &&\n \n-\tsed \"s/[a-f0-9]*\\.\\.\\./objid/\" foo >actual &&\n+\tsed \"s/[a-f0-9]* (/objid (/\" foo >actual &&\n \ttest_cmp expected actual\n '\n \n@@ -319,7 +319,7 @@ test_expect_success 'revert also handles conflicts sanely' '\n \ta\n \t=======\n \tb\n-\t>>>>>>> parent of objid picked\n+\t>>>>>>> parent of objid (picked)\n \tEOF\n \t{\n \t\tgit checkout picked -- foo &&\n@@ -345,7 +345,7 @@ test_expect_success 'revert also handles conflicts sanely' '\n \ttest_must_fail git update-index --refresh -q &&\n \ttest_must_fail git diff-index --exit-code HEAD &&\n \ttest_cmp expected-stages actual-stages &&\n-\tsed \"s/[a-f0-9]*\\.\\.\\./objid/\" foo >actual &&\n+\tsed \"s/[a-f0-9]* (/objid (/\" foo >actual &&\n \ttest_cmp expected actual\n '\n \n@@ -429,16 +429,16 @@ test_expect_success 'revert conflict, diff3 -m style' '\n \tcat <<-EOF >expected &&\n \t<<<<<<< HEAD\n \ta\n-\t||||||| objid picked\n+\t||||||| objid (picked)\n \tc\n \t=======\n \tb\n-\t>>>>>>> parent of objid picked\n+\t>>>>>>> parent of objid (picked)\n \tEOF\n \n \ttest_must_fail git revert picked &&\n \n-\tsed \"s/[a-f0-9]*\\.\\.\\./objid/\" foo >actual &&\n+\tsed \"s/[a-f0-9]* (/objid (/\" foo >actual &&\n \ttest_cmp expected actual\n '\n \n\nbase-commit: dc04167d378fb29d30e1647ff6ff51dd182bc9a3\n-- \ngitgitgadget\n"},{"id":"403642","messageId":"nycvar.QRO.7.76.6.2008141412370.54@tvgsbejvaqbjf.bet","threadId":"53990","inReplyTo":"pull.828.v2.git.git.1597243205137.gitgitgadget@gmail.com","subject":"Re: [PATCH v2] sequencer: avoid garbled merge machinery messages due to commit labels","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-08-14T12:12:55Z","receivedAt":"2020-08-14T12:13:02Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Elijah,\n\nOn Wed, 12 Aug 2020, Elijah Newren via GitGitGadget wrote:\n\n> From: Elijah Newren <newren@gmail.com>\n>\n> sequencer's get_message() exists to provide good labels on conflict\n> hunks; see commits\n>   d68565402a (\"revert: clarify label on conflict hunks\", 2010-03-20)\n>   bf975d379d (\"cherry-pick, revert: add a label for ancestor\", 2010-03-20)\n>   043a4492b3 (\"sequencer: factor code out of revert builtin\", 2012-01-11).\n> for background on this function.  These labels are of the form\n>   <commitID>... <commit summary>\n> or\n>   parent of <commitID>... <commit summary>\n> These labels are then passed as branch names to the merge machinery.\n> However, these labels, as formatted, often also serve to confuse.  For\n> example, if we have a rename involved in a content merge, then it\n> results in text such as the following:\n>\n>     <<<<<<<< HEAD:foo.c\n>       int j;\n>     ========\n>       int counter;\n>     >>>>>>>> b01dface... Removed unnecessary stuff:bar.c\n>\n> Or in various conflict messages, it can make it very difficult to read:\n>\n>     CONFLICT (rename/delete): foo.c deleted in b01dface... Removed\n>     unnecessary stuff and renamed in HEAD.  Version HEAD of foo.c left\n>     in tree.\n>\n>     CONFLICT (file location): dir1/foo.c added in b01dface... Removed\n>     unnecessary stuff inside a directory that was renamed in HEAD,\n>     suggesting it should perhaps be moved to dir2/foo.c.\n>\n> Make a minor change to remove the ellipses and add parentheses around\n> the commit summary; this makes all three examples much easier to read:\n>\n>     <<<<<<<< HEAD:foo.c\n>       int j;\n>     ========\n>       int counter;\n>     >>>>>>>> b01dface (Removed unnecessary stuff):bar.c\n>\n>     CONFLICT (rename/delete): foo.c deleted in b01dface (Removed\n>     unnecessary stuff) and renamed in HEAD.  Version HEAD of foo.c left\n>     in tree.\n>\n>     CONFLICT (file location): dir1/foo.c added in b01dface (Removed\n>     unnecessary stuff) inside a directory that was renamed in HEAD,\n>     suggesting it should perhaps be moved to dir2/foo.c.\n>\n> Signed-off-by: Elijah Newren <newren@gmail.com>\n> Reviewed-by: Taylor Blau <me@ttaylorr.com>\n> Acked-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>     sequencer: avoid garbled merge machinery messages due to commit labels\n>\n>     Changes since v1:\n>\n>      * Added Taylor's Reviewed-by, and Junio's Acked-by (I assume that's a\n>        fair translation of \"Looks good\", anyway; feel free to adjust when\n>        you apply otherwise).\n\nHere's my ACK, if you want it ;-)\n\nCiao,\nDscho\n\n>\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-828%2Fnewren%2Fsequencer-merge-messages-v2\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-828/newren/sequencer-merge-messages-v2\n> Pull-Request: https://github.com/git/git/pull/828\n>\n> Range-diff vs v1:\n>\n>  1:  da49e2eb58 ! 1:  762eb962cc sequencer: avoid garbled merge machinery messages due to commit labels\n>      @@ Commit message\n>               suggesting it should perhaps be moved to dir2/foo.c.\n>\n>           Signed-off-by: Elijah Newren <newren@gmail.com>\n>      +    Reviewed-by: Taylor Blau <me@ttaylorr.com>\n>      +    Acked-by: Junio C Hamano <gitster@pobox.com>\n>\n>        ## sequencer.c ##\n>       @@ sequencer.c: static int get_message(struct commit *commit, struct commit_message *out)\n>\n>\n>  sequencer.c                     |  2 +-\n>  t/t3404-rebase-interactive.sh   |  2 +-\n>  t/t3507-cherry-pick-conflict.sh | 20 ++++++++++----------\n>  3 files changed, 12 insertions(+), 12 deletions(-)\n>\n> diff --git a/sequencer.c b/sequencer.c\n> index fd7701c88a..e988c12ad2 100644\n> --- a/sequencer.c\n> +++ b/sequencer.c\n> @@ -355,7 +355,7 @@ static int get_message(struct commit *commit, struct commit_message *out)\n>  \tsubject_len = find_commit_subject(out->message, &subject);\n>\n>  \tout->subject = xmemdupz(subject, subject_len);\n> -\tout->label = xstrfmt(\"%s... %s\", abbrev, out->subject);\n> +\tout->label = xstrfmt(\"%s (%s)\", abbrev, out->subject);\n>  \tout->parent_label = xstrfmt(\"parent of %s\", out->label);\n>\n>  \treturn 0;\n> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\n> index 4a7d21f898..1d0a656ebd 100755\n> --- a/t/t3404-rebase-interactive.sh\n> +++ b/t/t3404-rebase-interactive.sh\n> @@ -256,7 +256,7 @@ test_expect_success 'stop on conflicting pick' '\n>  \tD\n>  \t=======\n>  \tG\n> -\t>>>>>>> $commit... G\n> +\t>>>>>>> $commit (G)\n>  \tEOF\n>  \tgit tag new-branch1 &&\n>  \ttest_must_fail git rebase -i master &&\n> diff --git a/t/t3507-cherry-pick-conflict.sh b/t/t3507-cherry-pick-conflict.sh\n> index 752bc43487..152ea11dc9 100755\n> --- a/t/t3507-cherry-pick-conflict.sh\n> +++ b/t/t3507-cherry-pick-conflict.sh\n> @@ -283,12 +283,12 @@ test_expect_success 'failed cherry-pick describes conflict in work tree' '\n>  \ta\n>  \t=======\n>  \tc\n> -\t>>>>>>> objid picked\n> +\t>>>>>>> objid (picked)\n>  \tEOF\n>\n>  \ttest_must_fail git cherry-pick picked &&\n>\n> -\tsed \"s/[a-f0-9]*\\.\\.\\./objid/\" foo >actual &&\n> +\tsed \"s/[a-f0-9]* (/objid (/\" foo >actual &&\n>  \ttest_cmp expected actual\n>  '\n>\n> @@ -298,16 +298,16 @@ test_expect_success 'diff3 -m style' '\n>  \tcat <<-EOF >expected &&\n>  \t<<<<<<< HEAD\n>  \ta\n> -\t||||||| parent of objid picked\n> +\t||||||| parent of objid (picked)\n>  \tb\n>  \t=======\n>  \tc\n> -\t>>>>>>> objid picked\n> +\t>>>>>>> objid (picked)\n>  \tEOF\n>\n>  \ttest_must_fail git cherry-pick picked &&\n>\n> -\tsed \"s/[a-f0-9]*\\.\\.\\./objid/\" foo >actual &&\n> +\tsed \"s/[a-f0-9]* (/objid (/\" foo >actual &&\n>  \ttest_cmp expected actual\n>  '\n>\n> @@ -319,7 +319,7 @@ test_expect_success 'revert also handles conflicts sanely' '\n>  \ta\n>  \t=======\n>  \tb\n> -\t>>>>>>> parent of objid picked\n> +\t>>>>>>> parent of objid (picked)\n>  \tEOF\n>  \t{\n>  \t\tgit checkout picked -- foo &&\n> @@ -345,7 +345,7 @@ test_expect_success 'revert also handles conflicts sanely' '\n>  \ttest_must_fail git update-index --refresh -q &&\n>  \ttest_must_fail git diff-index --exit-code HEAD &&\n>  \ttest_cmp expected-stages actual-stages &&\n> -\tsed \"s/[a-f0-9]*\\.\\.\\./objid/\" foo >actual &&\n> +\tsed \"s/[a-f0-9]* (/objid (/\" foo >actual &&\n>  \ttest_cmp expected actual\n>  '\n>\n> @@ -429,16 +429,16 @@ test_expect_success 'revert conflict, diff3 -m style' '\n>  \tcat <<-EOF >expected &&\n>  \t<<<<<<< HEAD\n>  \ta\n> -\t||||||| objid picked\n> +\t||||||| objid (picked)\n>  \tc\n>  \t=======\n>  \tb\n> -\t>>>>>>> parent of objid picked\n> +\t>>>>>>> parent of objid (picked)\n>  \tEOF\n>\n>  \ttest_must_fail git revert picked &&\n>\n> -\tsed \"s/[a-f0-9]*\\.\\.\\./objid/\" foo >actual &&\n> +\tsed \"s/[a-f0-9]* (/objid (/\" foo >actual &&\n>  \ttest_cmp expected actual\n>  '\n>\n>\n> base-commit: dc04167d378fb29d30e1647ff6ff51dd182bc9a3\n> --\n> gitgitgadget\n>\n"}]}