)]}'
{
  "commit": "a34c00d96851009e94ec7618ad5c1464f920c80d",
  "tree": "9e61f2c95bf87e381dbba10061271e43f22d29c5",
  "parents": [
    "bf3c696b44eb82f90b25101e36cd79651d1480f8"
  ],
  "author": {
    "name": "Pablo Sabater",
    "email": "pabloosabaterr@gmail.com",
    "time": "Tue Jul 14 14:09:35 2026 +0200"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Tue Jul 14 07:32:51 2026 -0700"
  },
  "message": "graph: indent visual root in graph\n\nWhen rendering a graph, if the history contains multiple \"visual roots\",\nactual roots or commits that look like roots (i.e. have their parents\nfiltered out) can end up being vertically adjacent to unrelated commits,\nfalsely appearing to be related.\n\nA fix for this issue was already attempted [1] a while ago.\n\nThis happens because the commits fill the space from left to right and\nwhen a visual root ends, its column becomes free for the following\ncommit even if they are not related. Once this happens the unrelated\ncommit is rendered below the visual root. Because there is no special\ncharacter or way to identify when a visual root is rendered making the\ngraph confusing.\n\nBy indenting the visual roots when there are still commits to show the\nvertical adjacency can be avoided.\n\nAdd is_visual_root flag to git_graph making it visible in all graph states,\ngive graph_update() a new function, graph_is_visual_root() to know if the\ncurrent commit is a visual root and set is_visual_root.\nThe different handled cases are:\n\n- If a visual root has children: similar to GRAPH_PRE_COMMIT state when\n  octopus merges need space, an edge row needs to be printed to connect\n  the child with the indented visual root. A new state GRAPH_PRE_ROOT is\n  needed to connect the child with the visual root:\n\n    * child of the visual root\n     \\ GRAPH_PRE_ROOT\n      * visual root indented\n\n- If a visual root is child-less we can skip GRAPH_PRE_ROOT state and\n  render the indented commit directly.\n\n      * visual root indented\n    * unrelated commit\n\n- If two or more visual roots are adjacent: by having a lookahead to the\n  next commit that will be rendered, if the next commit is also a visual\n  root and we are on a visual root, meaning two visual root adjacent in\n  the history, the top one can omit the indent, making the one below to\n  indent only once, if there are more adjacent visual commits, the\n  indentation will increase for each adjacent one, cascading.\n\n    * visual root\n      * visual root\n        * visual root\n    * last commit\n\n  Even if the last commit is a root, because there is nothing that will be\n  rendered below we can omit the indentation on purpose.\n\n[1]: https://lore.kernel.org/git/xmqqwnwajbuj.fsf@gitster.c.googlers.com/\n\nHelped-by: Kristofer Karlsson \u003ckrka@spotify.com\u003e\nMentored-by: Karthik Nayak \u003ckarthik.188@gmail.com\u003e\nMentored-by: Chandra Pratap \u003cchandrapratap3519@gmail.com\u003e\nSigned-off-by: Pablo Sabater \u003cpabloosabaterr@gmail.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "89ebcf7540589d34b5be93ca194f8cd2d2eebd50",
      "old_mode": 33188,
      "old_path": "graph.c",
      "new_id": "087094189f34671776c9ca71dcffb1468362e099",
      "new_mode": 33188,
      "new_path": "graph.c"
    },
    {
      "type": "modify",
      "old_id": "7c3c070426dc9ec7188469cf67ae7e56a2df39f5",
      "old_mode": 33188,
      "old_path": "t/meson.build",
      "new_id": "cce5ba71f961c7e7d6dfb561ad449f87760b3fe8",
      "new_mode": 33188,
      "new_path": "t/meson.build"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "60c7d84af7c9d63a9dfb1796083d66355fcdeb4c",
      "new_mode": 33261,
      "new_path": "t/t4218-log-graph-indentation.sh"
    }
  ]
}
