)]}'
{
  "commit": "3efb988098858bf6b974b1e673a190f9d2965d1d",
  "tree": "9fcbccbbb49f0e7ce19beb85e17c4e60a3ba2b5c",
  "parents": [
    "ecad27cf98c391d5cfdc26ce0e442e02347baad0"
  ],
  "author": {
    "name": "Jeff King",
    "email": "peff@peff.net",
    "time": "Thu Sep 24 19:12:23 2015 -0400"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Mon Sep 28 14:57:10 2015 -0700"
  },
  "message": "react to errors in xdi_diff\n\nWhen we call into xdiff to perform a diff, we generally lose\nthe return code completely. Typically by ignoring the return\nof our xdi_diff wrapper, but sometimes we even propagate\nthat return value up and then ignore it later.  This can\nlead to us silently producing incorrect diffs (e.g., \"git\nlog\" might produce no output at all, not even a diff header,\nfor a content-level diff).\n\nIn practice this does not happen very often, because the\ntypical reason for xdiff to report failure is that it\nmalloc() failed (it uses straight malloc, and not our\nxmalloc wrapper).  But it could also happen when xdiff\ntriggers one our callbacks, which returns an error (e.g.,\noutf() in builtin/rerere.c tries to report a write failure\nin this way). And the next patch also plans to add more\nfailure modes.\n\nLet\u0027s notice an error return from xdiff and react\nappropriately. In most of the diff.c code, we can simply\ndie(), which matches the surrounding code (e.g., that is\nwhat we do if we fail to load a file for diffing in the\nfirst place). This is not that elegant, but we are probably\nbetter off dying to let the user know there was a problem,\nrather than simply generating bogus output.\n\nWe could also just die() directly in xdi_diff, but the\ncallers typically have a bit more context, and can provide a\nbetter message (and if we do later decide to pass errors up,\nwe\u0027re one step closer to doing so).\n\nThere is one interesting case, which is in diff_grep(). Here\nif we cannot generate the diff, there is nothing to match,\nand we silently return \"no hits\". This is actually what the\nexisting code does already, but we make it a little more\nexplicit.\n\nSigned-off-by: Jeff King \u003cpeff@peff.net\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2b1f9dd6cd01be506c65441685b8d4b79cc74010",
      "old_mode": 33188,
      "old_path": "builtin/blame.c",
      "new_id": "66b4fbf466539a0947b0d6dde9e138b7cc0ed632",
      "new_mode": 33188,
      "new_path": "builtin/blame.c"
    },
    {
      "type": "modify",
      "old_id": "f9ab48597e58ed97fc208b58c17b8becb105e095",
      "old_mode": 33188,
      "old_path": "builtin/merge-tree.c",
      "new_id": "2a4aafec6a906e22713b88d90f350071bfdb1d59",
      "new_mode": 33188,
      "new_path": "builtin/merge-tree.c"
    },
    {
      "type": "modify",
      "old_id": "98eb8c5404914e4046fdb886866b611351deeacf",
      "old_mode": 33188,
      "old_path": "builtin/rerere.c",
      "new_id": "aab8f3b1f00fb9f5595e4485529759df89283a89",
      "new_mode": 33188,
      "new_path": "builtin/rerere.c"
    },
    {
      "type": "modify",
      "old_id": "91edce58e15b82428fcc5f3b006e23bf5380d38c",
      "old_mode": 33188,
      "old_path": "combine-diff.c",
      "new_id": "284bec6ad50de768f04a66d738d3655eff64a2c4",
      "new_mode": 33188,
      "new_path": "combine-diff.c"
    },
    {
      "type": "modify",
      "old_id": "7500c5509550ccd9a86d620e06c51a71d61f8b6c",
      "old_mode": 33188,
      "old_path": "diff.c",
      "new_id": "6bbf28bff2c8b04281c4a3224dd424990a17a153",
      "new_mode": 33188,
      "new_path": "diff.c"
    },
    {
      "type": "modify",
      "old_id": "185f86b2840d3337eac9fb2b17b260ca0c53fbab",
      "old_mode": 33188,
      "old_path": "diffcore-pickaxe.c",
      "new_id": "7715c13ec4780a755ec2a6552c0aec9994691087",
      "new_mode": 33188,
      "new_path": "diffcore-pickaxe.c"
    },
    {
      "type": "modify",
      "old_id": "1a6bc5921b4890273e4e9edab4d456cc27fd4064",
      "old_mode": 33188,
      "old_path": "line-log.c",
      "new_id": "d4e29a574f1fdbf4d5fc7426a9fc388bb68e4a14",
      "new_mode": 33188,
      "new_path": "line-log.c"
    }
  ]
}
