)]}'
{
  "commit": "e6e045f80314a4f37745676cbb92c8271ad07815",
  "tree": "ef8fcf7fcc7159e5415e4b6bc6268620ae46a9fc",
  "parents": [
    "146fdb0dfe445464fa438f3835557c58a01d85d7"
  ],
  "author": {
    "name": "Stefan Beller",
    "email": "sbeller@google.com",
    "time": "Thu Jun 29 17:07:06 2017 -0700"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Fri Jun 30 13:13:02 2017 -0700"
  },
  "message": "diff.c: buffer all output if asked to\n\nIntroduce a new option \u0027emitted_symbols\u0027 in the struct diff_options which\ncontrols whether all output is buffered up until all output is available.\nIt is set internally in diff.c when necessary.\n\nWe\u0027ll have a new struct \u0027emitted_string\u0027 in diff.c which will be used to\nbuffer each line.  The emitted_string will duplicate the memory of the\nline to buffer as that is easiest to reason about for now. In a future\npatch we may want to decrease the memory usage by not duplicating all\noutput for buffering but rather we may want to store offsets into the\nfile or in case of hunk descriptions such as the similarity score, we\ncould just store the relevant number and reproduce the text later on.\n\nThis approach was chosen as a first step because it is quite simple\ncompared to the alternative with less memory footprint.\n\nemit_diff_symbol factors out the emission part and depending on the\ndiff_options-\u003eemitted_symbols the emission will be performed directly\nwhen calling emit_diff_symbol or after the whole process is done, i.e.\nby buffering we have add the possibility for a second pass over the\nwhole output before doing the actual output.\n\nIn 6440d34 (2012-03-14, diff: tweak a _copy_ of diff_options with\nword-diff) we introduced a duplicate diff options struct for word\nemissions as we may have different regex settings in there.\nWhen buffering the output, we need to operate on just one buffer,\nso we have to copy back the emissions of the word buffer into the\nmain buffer.\n\nUnconditionally enable output via buffer in this patch as it yields\na great opportunity for testing, i.e. all the diff tests from the\ntest suite pass without having reordering issues (i.e. only parts\nof the output got buffered, and we forgot to buffer other parts).\nThe test suite passes, which gives confidence that we converted all\nfunctions to use emit_string for output.\n\nSigned-off-by: Stefan Beller \u003csbeller@google.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2db0d7c0f5c63c2e764d88cd04b1f5c335df20fe",
      "old_mode": 33188,
      "old_path": "diff.c",
      "new_id": "31720abf8f9cc6ce8e62de9a67afb54d8e20a7a8",
      "new_mode": 33188,
      "new_path": "diff.c"
    },
    {
      "type": "modify",
      "old_id": "d6094a1eedc1542e7cc402b548bc2881aa7eafeb",
      "old_mode": 33188,
      "old_path": "diff.h",
      "new_id": "4a3b9bde4064ba365dcf836092f7aef0e749896c",
      "new_mode": 33188,
      "new_path": "diff.h"
    }
  ]
}
