)]}'
{
  "commit": "2f5ff2c339d90422dd4010b5d980d33d1959fdd9",
  "tree": "1a42953968992ed273fba9e948915ed34648f563",
  "parents": [
    "d35c5399e3e54ac277bb391fc2f6be3e816d312b"
  ],
  "author": {
    "name": "Phillip Wood",
    "email": "phillip.wood@dunelm.org.uk",
    "time": "Sun Jul 26 16:38:59 2026 +0100"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Sun Jul 26 14:02:01 2026 -0700"
  },
  "message": "rebase -i: fix counting of fixups after rebase --skip\n\nWhen the sequencer processes a chain of \"fixup\" and \"squash\" commands\nit keeps a list of the commands that have been executed. If there are\nconflicts, then the list is saved when the rebase stops for the user to\nresolve them. When the rebase resumes, the list is loaded and is used\nto initialize the count of how many \"fixup\" and \"squash\" commands have\nbeen processed; if a command has been skipped with \"git rebase --skip\",\nthen the last command needs to be popped off the end of the list.\n\nTo count the number of commands, commit_staged_changes() uses the\nnumber of newlines in the file plus one. This is due to the slightly\nunusual way the list is constructed - instead of appending a newline\nwhen a command is added, a newline is inserted before the command\nif the current count is greater than zero. Therefore, when we pop a\nskipped command off the list, we should also remove the newline that\nprecedes it. Otherwise, when a new command is added, a blank line\nwill be left before it, which will contribute to the fixup count the\nnext time the file is read. Unfortunately, the preceding newline is\nnot removed, leading to an incorrect count. Fix this by removing the\nnewline that appears before the skipped command.\n\nIn addition to fixing the code that removes a skipped command from the\nlist, the code that reads the list is fixed to skip blank lines. We\nhave had reports of users starting a rebase with one version of\ngit and continuing it with another. Often this happens because the\nversion of git bundled with an IDE or TUI differs from the one used\nat the command line. By fixing both the reading and writing ends of\nthe problem we ensure the count is correct when an older version of\ngit reads the fixup file written by a newer version and vice versa.\n\nTriggering the incorrect count requires the user to skip two \"fixup\" or\n\"squash\" commands before the final command in the chain. An existing\ntest is extended to prevent future regressions. The consequence of\nmiscounting is not serious: we just print the wrong count in the\nheader of the commit message template.\n\nSigned-off-by: Phillip Wood \u003cphillip.wood@dunelm.org.uk\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "1355a99a0922681a4443b03df7387974009d1fee",
      "old_mode": 33188,
      "old_path": "sequencer.c",
      "new_id": "4640ee9b7f536b7e3bfb37b7c82ecff3307759b4",
      "new_mode": 33188,
      "new_path": "sequencer.c"
    },
    {
      "type": "modify",
      "old_id": "f9b8999db50f1b77f03ec51cec01ace8849a9137",
      "old_mode": 33261,
      "old_path": "t/t3418-rebase-continue.sh",
      "new_id": "3c248e973649ea20c38d1a7548bbe78b077e107c",
      "new_mode": 33261,
      "new_path": "t/t3418-rebase-continue.sh"
    }
  ]
}
