)]}'
{
  "commit": "1d7297513df66873e68af4b254804151b8ba5359",
  "tree": "b13311d7572e5488bef01283449d2ce06d0323d0",
  "parents": [
    "66f79ee23d51ac11784aeb0ef4f4119af9fbb984"
  ],
  "author": {
    "name": "Denton Liu",
    "email": "liu.denton@gmail.com",
    "time": "Wed Dec 11 16:49:50 2019 -0800"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Fri Dec 13 11:07:15 2019 -0800"
  },
  "message": "notes: break set_display_notes() into smaller functions\n\nIn 8164c961e1 (format-patch: use --notes behavior for format.notes,\n2019-12-09), we introduced set_display_notes() which was a monolithic\nfunction with three mutually exclusive branches. Break the function up\ninto three small and simple functions that each are only responsible for\none task.\n\nThis family of functions accepts an `int *show_notes` instead of\nreturning a value suitable for assignment to `show_notes`. This is for\ntwo reasons. First of all, this guarantees that the external\n`show_notes` variable changes in lockstep with the\n`struct display_notes_opt`. Second, this prompts future developers to be\ncareful about doing something meaningful with this value. In fact, a\nNULL check is intentionally omitted because causing a segfault here\nwould tell the future developer that they are meant to use the value for\nsomething meaningful.\n\nOne alternative was making the family of functions accept a\n`struct rev_info *` instead of the `struct display_notes_opt *`, since\nthe former contains the `show_notes` field as well. This does not work\nbecause we have to call git_config() before repo_init_revisions().\nHowever, if we had a `struct rev_info`, we\u0027d need to initialize it before\nit gets assigned values from git_config(). As a result, we break the\ncircular dependency by having standalone `int show_notes` and\n`struct display_notes_opt notes_opt` variables which temporarily hold\nvalues from git_config() until the values are copied over to `rev`.\n\nTo implement this change, we need to get a pointer to\n`rev_info::show_notes`. Unfortunately, this is not possible with\nbitfields and only direct-assignment is possible. Change\n`rev_info::show_notes` to a non-bitfield int so that we can get its\naddress.\n\nSigned-off-by: Denton Liu \u003cliu.denton@gmail.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4225615e7fcca60a9b49a7f445d1992f87c0220b",
      "old_mode": 33188,
      "old_path": "builtin/log.c",
      "new_id": "b6d43a4a47ebbc39e36c5552b3bd0fdc5ae44404",
      "new_mode": 33188,
      "new_path": "builtin/log.c"
    },
    {
      "type": "modify",
      "old_id": "c93feff4abd306bc9fdc59aa775e3a0c924cfd2a",
      "old_mode": 33188,
      "old_path": "notes.c",
      "new_id": "3133bb181faaba089b8cb68b1b3eb18447b23db3",
      "new_mode": 33188,
      "new_path": "notes.c"
    },
    {
      "type": "modify",
      "old_id": "a476bfa06659a9d6c8bc12538f150cde06898b86",
      "old_mode": 33188,
      "old_path": "notes.h",
      "new_id": "3e784481815c4d67740329ecb3ee91aafda24a9c",
      "new_mode": 33188,
      "new_path": "notes.h"
    },
    {
      "type": "modify",
      "old_id": "c2d8d24939dd7eb6b892accbd1680ec3cedf5ffb",
      "old_mode": 33188,
      "old_path": "revision.c",
      "new_id": "1b12ed742bfe8862e2eb9e582490df3f5a208891",
      "new_mode": 33188,
      "new_path": "revision.c"
    },
    {
      "type": "modify",
      "old_id": "4134dc6029c40f39659b39927ba239aed845673b",
      "old_mode": 33188,
      "old_path": "revision.h",
      "new_id": "72520780f4522681862385fc033d8ec878cd59f3",
      "new_mode": 33188,
      "new_path": "revision.h"
    }
  ]
}
