)]}'
{
  "commit": "2760ee49834953c0860fa5d7983a6af4d27cb6a9",
  "tree": "9798f8a97b0a3a52c048501c9990756da1a42e88",
  "parents": [
    "1e6434ebbd63d4ec0ad2f8bccf25bd0d98d55030"
  ],
  "author": {
    "name": "Siddharth Asthana",
    "email": "siddharthasthana31@gmail.com",
    "time": "Thu Mar 26 01:53:52 2026 +0530"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Wed Mar 25 14:21:20 2026 -0700"
  },
  "message": "replay: add --revert mode to reverse commit changes\n\nAdd a `--revert \u003cbranch\u003e` mode to git replay that undoes the changes\nintroduced by the specified commits. Like --onto and --advance, --revert\nis a standalone mode: it takes a branch argument and updates that branch\nwith the newly created revert commits.\n\nAt GitLab, we need this in Gitaly for reverting commits directly on bare\nrepositories without requiring a working tree checkout.\n\nThe approach is the same as sequencer.c\u0027s do_pick_commit() -- cherry-pick\nand revert are just the same three-way merge with swapped arguments:\n\n  - Cherry-pick: merge(ancestor\u003dparent, ours\u003dcurrent, theirs\u003dcommit)\n  - Revert: merge(ancestor\u003dcommit, ours\u003dcurrent, theirs\u003dparent)\n\nWe swap the base and pickme trees passed to merge_incore_nonrecursive()\nto reverse the diff direction.\n\nReverts are processed newest-first (matching git revert behavior) to\nreduce conflicts by peeling off changes from the top. Each revert\nbuilds on the result of the previous one via the last_commit fallback\nin the main replay loop, rather than relying on the parent-mapping\nused for cherry-pick.\n\nRevert commit messages follow the usual git revert conventions: prefixed\nwith \"Revert\" (or \"Reapply\" when reverting a revert), and including\n\"This reverts commit \u003chash\u003e.\". The author is set to the current user\nrather than preserving the original author, matching git revert behavior.\n\nHelped-by: Christian Couder \u003cchristian.couder@gmail.com\u003e\nHelped-by: Patrick Steinhardt \u003cps@pks.im\u003e\nHelped-by: Elijah Newren \u003cnewren@gmail.com\u003e\nHelped-by: Phillip Wood \u003cphillip.wood123@gmail.com\u003e\nHelped-by: Johannes Schindelin \u003cJohannes.Schindelin@gmx.de\u003e\nHelped-by: Junio C Hamano \u003cgitster@pobox.com\u003e\nHelped-by: Toon Claes \u003ctoon@iotcl.com\u003e\nSigned-off-by: Siddharth Asthana \u003csiddharthasthana31@gmail.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8d696ce3abb4917da69fb1d9d396efaddc842e7a",
      "old_mode": 33188,
      "old_path": "Documentation/git-replay.adoc",
      "new_id": "997097e42055237f7a61e7de17244425a9ee4af6",
      "new_mode": 33188,
      "new_path": "Documentation/git-replay.adoc"
    },
    {
      "type": "modify",
      "old_id": "2cdde830a8a0f4dddd6ad9bfb6796f5faebaa0c8",
      "old_mode": 33188,
      "old_path": "builtin/replay.c",
      "new_id": "a0879b020f456ae718aa920db6e49064e862ef60",
      "new_mode": 33188,
      "new_path": "builtin/replay.c"
    },
    {
      "type": "modify",
      "old_id": "f97d652f338f1df47788e4024d5f08c38943e813",
      "old_mode": 33188,
      "old_path": "replay.c",
      "new_id": "199066f6b34afee2d01054af37b7879b3a43e976",
      "new_mode": 33188,
      "new_path": "replay.c"
    },
    {
      "type": "modify",
      "old_id": "d8407dc7f710fca0014fe8a6bd2faaf85e62347c",
      "old_mode": 33188,
      "old_path": "replay.h",
      "new_id": "e916a5f975be2628133483e1ac18bb9e354b5bad",
      "new_mode": 33188,
      "new_path": "replay.h"
    },
    {
      "type": "modify",
      "old_id": "a03f8f9293eb12853e6ba6608ccf543359f3aa13",
      "old_mode": 33261,
      "old_path": "t/t3650-replay-basics.sh",
      "new_id": "217f6fb292a068723446f52e53c589617fd5a8ee",
      "new_mode": 33261,
      "new_path": "t/t3650-replay-basics.sh"
    }
  ]
}
