)]}'
{
  "commit": "6966efb0f6ff0f80b1a6bc5ee6ac2f343ecf3523",
  "tree": "f094107d1e05a2a0648ca1db3bfd66ba0e5a97bb",
  "parents": [
    "2d9fd62c6572e324ae893e2c5bc2f054b7f70fa4"
  ],
  "author": {
    "name": "RJ Ascani",
    "email": "rjascani@google.com",
    "time": "Mon Oct 19 16:50:11 2020 -0700"
  },
  "committer": {
    "name": "Commit Bot",
    "email": "commit-bot@chromium.org",
    "time": "Fri Dec 11 17:17:17 2020 +0000"
  },
  "message": "Restat build.ninja after gen\n\nAs of version 1.8, ninja caches mtimes in the .ninja_log file and will\nnot restat a file if it has an entry in the .ninja_log. This becomes\nproblematic for generator files such as build.ninja. In a scenario where\nthe .ninja_log has an entry for build.ninja (ie, after ninja has had to\ntrigger a re-gen) and a manual run of of `gn gen` has updated the\nbuild.ninja file, a subsequent invocation of ninja will trigger yet\nanother re-gen of build.ninja.\n\nThis can be reproduced like this:\n\n  # Initial build\n  gn gen out \u0026\u0026 ninja -C out\n  # Trigger ninja re-gen so there\u0027s a build.ninja log entry\n  touch BUILD.gn \u0026\u0026 ninja -C out\n  # Manual re-gen\n  gn gen out\n  # The following command will re-gen again before building\n  ninja -C out\n\nTo work around this, the recommended approach from ninja is to use the\nninja restat tool to get ninja to update the mtime in the .ninja_log.\nThis CL does that by attempting to invoke `ninja -t restat build.ninja`\nimmediately after the build.ninja is generated by `gn gen`. Because this\ntool was only introduced in 1.10, the usage is gated on having a ninja\nbinary of at least that version. The ninja binary can be provided via\nthe --ninja-executable switch.\n\nBug: 136\nChange-Id: If40391aa13e6ef71c4e8ab26aff57d66a8137b8e\nReviewed-on: https://gn-review.googlesource.com/c/gn/+/10400\nCommit-Queue: RJ Ascani \u003crjascani@google.com\u003e\nReviewed-by: Brett Wilson \u003cbrettw@chromium.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "486354bf47787ea44253a1b690fc06b504628444",
      "old_mode": 33261,
      "old_path": "build/gen.py",
      "new_id": "0f40b75ae4b19512ddf1a7aba928a8a7406134be",
      "new_mode": 33261,
      "new_path": "build/gen.py"
    },
    {
      "type": "modify",
      "old_id": "06ab5a01104708bfbb3a45e88e1edbb447d6c927",
      "old_mode": 33188,
      "old_path": "docs/reference.md",
      "new_id": "8eb1510c7c031eb49ae70f8bc63b69b1a305c481",
      "new_mode": 33188,
      "new_path": "docs/reference.md"
    },
    {
      "type": "modify",
      "old_id": "7c7fd01ec2a443345784ccfce396fa6cb3879ad6",
      "old_mode": 33188,
      "old_path": "src/gn/command_gen.cc",
      "new_id": "44372367f699b0517c3157a05fb707fb8b93e79d",
      "new_mode": 33188,
      "new_path": "src/gn/command_gen.cc"
    },
    {
      "type": "modify",
      "old_id": "164c1d5a3d4867d6572bb86a784a0b0acd1a9894",
      "old_mode": 33188,
      "old_path": "src/gn/ninja_build_writer.cc",
      "new_id": "04e0754f973b2a07fa888a1cbbb63b3d006f49f0",
      "new_mode": 33188,
      "new_path": "src/gn/ninja_build_writer.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "ed455441789c3656cabfe98ae913b31bd5a022e1",
      "new_mode": 33188,
      "new_path": "src/gn/ninja_tools.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "4eda1e13086aed7613eca65078650aef0193000a",
      "new_mode": 33188,
      "new_path": "src/gn/ninja_tools.h"
    },
    {
      "type": "modify",
      "old_id": "0ad3a6bea46a27cb6709fe2ddaa2f086c6256abe",
      "old_mode": 33188,
      "old_path": "src/gn/switches.cc",
      "new_id": "fb63b308ec1277a879f740c06f14d9e10d7e65d5",
      "new_mode": 33188,
      "new_path": "src/gn/switches.cc"
    },
    {
      "type": "modify",
      "old_id": "2f89e500f14c6378b6d10a23ee9fc3614a836c35",
      "old_mode": 33188,
      "old_path": "src/gn/switches.h",
      "new_id": "2382bb7aeded801a7eee24bc909adbfcd374f15c",
      "new_mode": 33188,
      "new_path": "src/gn/switches.h"
    }
  ]
}
