)]}'
{
  "commit": "4a164c8f55619e2bf79f9f62c86b8e4448c931d4",
  "tree": "33667120ee5c5dd5657d718594269c9ca9547df5",
  "parents": [
    "f9bd630375efb21f00e28f6671cc9ab257b0c85d"
  ],
  "author": {
    "name": "Scott Graham",
    "email": "scottmg@chromium.org",
    "time": "Wed Nov 18 13:43:59 2020 -0800"
  },
  "committer": {
    "name": "Commit Bot",
    "email": "commit-bot@chromium.org",
    "time": "Fri Nov 20 20:38:13 2020 +0000"
  },
  "message": "Support `format --read-tree\u003djson`\n\nAllows roundtripping to json and back with `gn format --dump-tree\u003djson\na.gn` and then `gn format --read-tree\u003djson a.gn`. The preexisting\n.json format is not the most pleasant to work with, but this does at\nleast allow for programmatic editing of the gn files with knowledge of\nstructure, going beyond naive string replacement.\n\nFor example, a python script to change `deps` inside `source_sets` from\n`\u003d` to `+\u003d` to support a BUILDCONFIG.gn change:\nhttps://gist.github.com/sgraham/bd9ffee312f307d5f417019a9c0f0777\n\nThe .json format was extended slightly, mostly to include location\ninformation which is necessary to faithfully roundtrip including\nwhitespace. If the input .gn is formatted by `gn format`, then it can\nroundtrip to json without change. This was confirmed by running\n--dump-tree\u003djson \u003d\u003e --read-tree\u003djson on all .gn and .gni files in both\nthe Fuchsia and Chromium trees\n(https://gist.github.com/sgraham/bc561f19cd354746dd2469103e1f97d4), as\nwell as by adding a roundtrip step to the formatter tests in-repo.\n\nChange-Id: Ie10bbbcb32b8184400ca9bb1f6ab63e5ca9c89e7\nReviewed-on: https://gn-review.googlesource.com/c/gn/+/10700\nReviewed-by: Brett Wilson \u003cbrettw@chromium.org\u003e\nCommit-Queue: Scott Graham \u003cscottmg@chromium.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "20b3ccbdb3f9b2fbd0d821f694977cdafaaeb5aa",
      "old_mode": 33188,
      "old_path": "src/gn/command_format.cc",
      "new_id": "e94fb4fbc6d0e78f3364a246948a6f5c0b9a8f56",
      "new_mode": 33188,
      "new_path": "src/gn/command_format.cc"
    },
    {
      "type": "modify",
      "old_id": "785b0706be469c51cce0fc9deb24dffcc7f54624",
      "old_mode": 33188,
      "old_path": "src/gn/command_format.h",
      "new_id": "0eb667fa2530e97e6128280ea0d678a72fe59ced",
      "new_mode": 33188,
      "new_path": "src/gn/command_format.h"
    },
    {
      "type": "modify",
      "old_id": "2141f6fc25cadee25d54a1c8c26f85c959ced87b",
      "old_mode": 33188,
      "old_path": "src/gn/command_format_unittest.cc",
      "new_id": "9112dd36229d74441e1b32f7d3bdb819297dbde5",
      "new_mode": 33188,
      "new_path": "src/gn/command_format_unittest.cc"
    },
    {
      "type": "modify",
      "old_id": "e62b87e47ab901ef1c86f063bcca3832b2dba332",
      "old_mode": 33188,
      "old_path": "src/gn/parse_tree.cc",
      "new_id": "74bc2afdbe9025b1c13cb7ff5b2e247284ae5c1a",
      "new_mode": 33188,
      "new_path": "src/gn/parse_tree.cc"
    },
    {
      "type": "modify",
      "old_id": "cb64661c5e6c3b6a4491daf4dc72f1710578fbb3",
      "old_mode": 33188,
      "old_path": "src/gn/parse_tree.h",
      "new_id": "9ffacc20798d4e6c6356c1009106f3e32144f263",
      "new_mode": 33188,
      "new_path": "src/gn/parse_tree.h"
    },
    {
      "type": "modify",
      "old_id": "0cb7314cd22be4930d7d7a63f7f6c1796c492fad",
      "old_mode": 33188,
      "old_path": "src/gn/parser.cc",
      "new_id": "07e9ba326c6c32c4ef394af92c2e979f02c107da",
      "new_mode": 33188,
      "new_path": "src/gn/parser.cc"
    },
    {
      "type": "modify",
      "old_id": "8c402f1cbe20f0a344a026b675d401233630f6a3",
      "old_mode": 33188,
      "old_path": "src/gn/setup.cc",
      "new_id": "0e3e4a2fb9f8fe93d309f9f270656028c6247f79",
      "new_mode": 33188,
      "new_path": "src/gn/setup.cc"
    },
    {
      "type": "modify",
      "old_id": "0466ce77b2e6a78dcdf31f2e12961948c973d2bb",
      "old_mode": 33188,
      "old_path": "src/gn/token.cc",
      "new_id": "3af9c48f36fd2ddf31883761e9539e3b6c883e36",
      "new_mode": 33188,
      "new_path": "src/gn/token.cc"
    },
    {
      "type": "modify",
      "old_id": "c0746202cb9441e6fac6f5c1fe6db05be0c86d81",
      "old_mode": 33188,
      "old_path": "src/gn/token.h",
      "new_id": "a11807a47d8a0a65deb8b56e28149c1f1649da5e",
      "new_mode": 33188,
      "new_path": "src/gn/token.h"
    },
    {
      "type": "modify",
      "old_id": "eec234999111d3f8ef44e66cb430408025211b9d",
      "old_mode": 33188,
      "old_path": "src/gn/tokenizer.cc",
      "new_id": "93a64259de6f2bacbc2fc4114c2c1dcde539f286",
      "new_mode": 33188,
      "new_path": "src/gn/tokenizer.cc"
    },
    {
      "type": "modify",
      "old_id": "fb74d2a88d7fd981c69690c451d1c6adc0a739ad",
      "old_mode": 33188,
      "old_path": "src/gn/tokenizer.h",
      "new_id": "d4b347bdbda892c3e1a8fadd4cf1875d4e38a2e8",
      "new_mode": 33188,
      "new_path": "src/gn/tokenizer.h"
    }
  ]
}
