)]}'
{
  "commit": "59f9d206c954b5633f5978723bd0a2e7db31c2e8",
  "tree": "eee0571db82d18ebbeb7b9f396c04a174277720e",
  "parents": [
    "e9d728ceb7365b6cf0b1472021fdbb76d59a02d1"
  ],
  "author": {
    "name": "Thomas Wolf",
    "email": "thomas.wolf@paranor.ch",
    "time": "Tue Aug 06 18:31:35 2019 +0200"
  },
  "committer": {
    "name": "Matthias Sohn",
    "email": "matthias.sohn@sap.com",
    "time": "Wed Nov 27 03:03:06 2019 +0100"
  },
  "message": "Make blame work correctly on merge conflicts\n\nWhen a conflicting file was blamed, JGit would not identify lines\ncoming from the merge parents. The main cause for this was that\nBlame and BlameCommand simply added the first DirCacheEntry found\nfor a file to its queue of candidates (blobs or commits) to consider.\nIn case of a conflict this typically is the merge base commit, and\ncomparing a auto-merged contents against that base would yield\nincorrect results.\n\nSuch cases have to be handled specially. The candidate to be\nconsidered by the blame must use the working tree contents, but\nat the same time behave like a merge commit/candidate with HEAD\nand the MERGE_HEADs as parents. Canonical git does something very\nsimilar, see [1].\n\nImplement that and add tests.\n\nI first did this for the JGit pgm Blame command. When I then tried\nto do the same in BlameCommand, I noticed that the latter also\nincluded some fancy but incomplete CR-LF handling. In order to\nbe able to use the new BlameGenerator.prepareHead() also in\nBlameCommand this CR-LF handling was also moved into BlameGenerator\nand corrected in doing so.\n\n(Just considering the git config settings was not good enough,\nCR-LF behavior can also be influenced by .gitattributes, and even\nby whether the file in the index has CR-LF. To correctly determine\nCR-LF handling for check-in one needs to do a TreeWalk with at\nleast a FileTreeIterator and a DirCacheIterator.)\n\n[1] https://github.com/git/git/blob/v2.22.0/blame.c#L174\n\nBug: 434330\nChange-Id: I9d763dd6ba478b0b6ebf9456049d6301f478ef7c\nSigned-off-by: Thomas Wolf \u003cthomas.wolf@paranor.ch\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e806872c14ed70a08f7b930b0ba97609837ffccb",
      "old_mode": 33188,
      "old_path": "org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/BlameTest.java",
      "new_id": "732c54e33223393b205cd708fc34e1c362b29565",
      "new_mode": 33188,
      "new_path": "org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/BlameTest.java"
    },
    {
      "type": "modify",
      "old_id": "b67b04c5becf92c7a0ff42addc8dbe4582fd2aab",
      "old_mode": 33188,
      "old_path": "org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Blame.java",
      "new_id": "f85d8d49a248ced8dcf2a75e4a9a638860a58a3b",
      "new_mode": 33188,
      "new_path": "org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Blame.java"
    },
    {
      "type": "modify",
      "old_id": "7e73084e8e7744aa93c5edc3699e745263e32afd",
      "old_mode": 33188,
      "old_path": "org.eclipse.jgit.test/tst/org/eclipse/jgit/api/BlameCommandTest.java",
      "new_id": "4d1375a2f50d52aa8da823acff62598879f85030",
      "new_mode": 33188,
      "new_path": "org.eclipse.jgit.test/tst/org/eclipse/jgit/api/BlameCommandTest.java"
    },
    {
      "type": "modify",
      "old_id": "882b766f4f6bd3e9425cfc9dcc2f26a981a8d7ce",
      "old_mode": 33188,
      "old_path": "org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties",
      "new_id": "27d3e6aaa3769d61d5fcce56579902bea8b7ae81",
      "new_mode": 33188,
      "new_path": "org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties"
    },
    {
      "type": "modify",
      "old_id": "0c765b01cb892b4e68f5c0681896b65a2e272fb9",
      "old_mode": 33188,
      "old_path": "org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java",
      "new_id": "a69aa70c6e7cd0c470a8b484082043627101fc1b",
      "new_mode": 33188,
      "new_path": "org.eclipse.jgit/src/org/eclipse/jgit/api/BlameCommand.java"
    },
    {
      "type": "modify",
      "old_id": "9cec64567956fd1c83f1ed1ea45e33d55371c99b",
      "old_mode": 33188,
      "old_path": "org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java",
      "new_id": "d0aa292df4ee815f058f32746620b0f71de92bfc",
      "new_mode": 33188,
      "new_path": "org.eclipse.jgit/src/org/eclipse/jgit/blame/BlameGenerator.java"
    },
    {
      "type": "modify",
      "old_id": "457d1d2ceafcf6dd9a9ac4a67b66848f75d87016",
      "old_mode": 33188,
      "old_path": "org.eclipse.jgit/src/org/eclipse/jgit/blame/Candidate.java",
      "new_id": "3ef49439822d6ec20136738bac843f50afdc56c7",
      "new_mode": 33188,
      "new_path": "org.eclipse.jgit/src/org/eclipse/jgit/blame/Candidate.java"
    },
    {
      "type": "modify",
      "old_id": "65c9629461fabd5ec1d1d9196cb9bb1525fd5d53",
      "old_mode": 33188,
      "old_path": "org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java",
      "new_id": "0cea60fd95f62aca438ccaf1bb65cddaaa4880d0",
      "new_mode": 33188,
      "new_path": "org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java"
    }
  ]
}
