{"thread":{"id":"59570","subject":"[PATCH] git-merge: improve conflict presentation documentation","startedAt":"2023-04-10T14:03:35Z","lastAt":"2023-04-10T14:03:35Z","messageCount":1,"participants":["Adam Johnson via GitGitGadget"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"475062","messageId":"pull.1494.git.git.1681135384039.gitgitgadget@gmail.com","threadId":"59570","inReplyTo":null,"subject":"[PATCH] git-merge: improve conflict presentation documentation","fromName":"Adam Johnson via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2023-04-10T14:03:03Z","receivedAt":"2023-04-10T14:03:35Z","isPatch":true,"sender":{"key":"me@adamj.eu","avatar":"https://avatars.githubusercontent.com/u/857609?v=4"},"body":"From: Adam Johnson <me@adamj.eu>\n\nImporvements:\n\n1. Remove the sexist example (\"Barbie... wants to go shopping\")\n2. Show real merge marker contents, rather than e.g. \"yours:sample.txt\".\n3. Swap yours/theirs terms for source/target.\n4. General wordsmithing.\n\nSigned-off-by: Adam Johnson <me@adamj.eu>\n---\n    git-merge: improve conflict presentation documentation\n    \n    Imporvements:\n    \n     1. Remove the sexist example (\"Barbie... wants to go shopping\")\n     2. Show real merge marker contents, rather than e.g.\n        \"yours:sample.txt\".\n     3. Swap yours/theirs terms for source/target.\n     4. General wordsmithing.\n    \n    Signed-off-by: Adam Johnson me@adamj.eu\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1494%2Fadamchainz%2Fgit_merge_conflicts-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1494/adamchainz/git_merge_conflicts-v1\nPull-Request: https://github.com/git/git/pull/1494\n\n Documentation/git-merge.txt | 67 ++++++++++++++++++-------------------\n 1 file changed, 33 insertions(+), 34 deletions(-)\n\ndiff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt\nindex 0aeff572a59..409a564ca39 100644\n--- a/Documentation/git-merge.txt\n+++ b/Documentation/git-merge.txt\n@@ -245,71 +245,70 @@ from the RCS suite to present such a conflicted hunk, like this:\n ------------\n Here are lines that are either unchanged from the common\n ancestor, or cleanly resolved because only one side changed,\n-or cleanly resolved because both sides changed the same way.\n-<<<<<<< yours:sample.txt\n-Conflict resolution is hard;\n-let's go shopping.\n+or cleanly resolved because both sides changed identically.\n+<<<<<<< HEAD\n+Git makes conflict resolution straightforward.\n =======\n Git makes conflict resolution easy.\n->>>>>>> theirs:sample.txt\n+>>>>>>> main\n And here is another line that is cleanly resolved or unmodified.\n ------------\n \n The area where a pair of conflicting changes happened is marked with markers\n `<<<<<<<`, `=======`, and `>>>>>>>`.  The part before the `=======`\n-is typically your side, and the part afterwards is typically their side.\n+is typically the target that you’re merging into, and the part afterwards\n+is typically the source that you’re merging from.\n+\n+The default format does not show what the original version contained in the\n+conflicting area.  You cannot tell how many lines have been deleted and\n+replaced on either side. The only thing you can tell is that the target side\n+says \"straightforward\", while the source side says \"easy\".\n \n-The default format does not show what the original said in the conflicting\n-area.  You cannot tell how many lines are deleted and replaced with\n-Barbie's remark on your side.  The only thing you can tell is that your\n-side wants to say it is hard and you'd prefer to go shopping, while the\n-other side wants to claim it is easy.\n+You can use an alternative conflict marker style by setting the\n+`merge.conflictStyle` configuration variable to either \"diff3\" or \"zdiff3\".\n+Both of these styles show the original version of the conflicted area, which\n+may help you find a better resolution.\n \n-An alternative style can be used by setting the \"merge.conflictStyle\"\n-configuration variable to either \"diff3\" or \"zdiff3\".  In \"diff3\"\n-style, the above conflict may look like this:\n+In the \"diff3\" style, the above conflict looks like this:\n \n ------------\n Here are lines that are either unchanged from the common\n ancestor, or cleanly resolved because only one side changed,\n-<<<<<<< yours:sample.txt\n-or cleanly resolved because both sides changed the same way.\n-Conflict resolution is hard;\n-let's go shopping.\n-||||||| base:sample.txt\n+<<<<<<< HEAD\n or cleanly resolved because both sides changed identically.\n+Git makes conflict resolution straightforward.\n+||||||| 81821ce\n+or cleanly resolved because both sides changed the same way.\n Conflict resolution is hard.\n =======\n-or cleanly resolved because both sides changed the same way.\n+or cleanly resolved because both sides changed identically.\n Git makes conflict resolution easy.\n->>>>>>> theirs:sample.txt\n+>>>>>>> main\n And here is another line that is cleanly resolved or unmodified.\n ------------\n \n-while in \"zdiff3\" style, it may look like this:\n+while in the \"zdiff3\" style, it looks like this:\n \n ------------\n Here are lines that are either unchanged from the common\n ancestor, or cleanly resolved because only one side changed,\n-or cleanly resolved because both sides changed the same way.\n-<<<<<<< yours:sample.txt\n-Conflict resolution is hard;\n-let's go shopping.\n-||||||| base:sample.txt\n or cleanly resolved because both sides changed identically.\n+<<<<<<< HEAD\n+Git makes conflict resolution straightforward.\n+||||||| 81821ce\n+or cleanly resolved because both sides changed the same way.\n Conflict resolution is hard.\n =======\n Git makes conflict resolution easy.\n->>>>>>> theirs:sample.txt\n+>>>>>>> main\n And here is another line that is cleanly resolved or unmodified.\n ------------\n \n-In addition to the `<<<<<<<`, `=======`, and `>>>>>>>` markers, it uses\n-another `|||||||` marker that is followed by the original text.  You can\n-tell that the original just stated a fact, and your side simply gave in to\n-that statement and gave up, while the other side tried to have a more\n-positive attitude.  You can sometimes come up with a better resolution by\n-viewing the original.\n+The original commit SHA and text are shown after another marker, `|||||||`.\n+This region lets you now see that both sides made the edit from \"the same way\"\n+to \"identically\", as well as editing the following line.  The \"diff3\" style\n+keeps all changed lines within the markers, whilst the \"zdiff3\" style moves the\n+commonly edited line before the marker.\n \n \n HOW TO RESOLVE CONFLICTS\n\nbase-commit: f285f68a132109c234d93490671c00218066ace9\n-- \ngitgitgadget\n"}]}