Siddharth Asthana
f79189a653
replay: add --revert mode to reverse commit changes
...
Add a `--revert <branch>` mode to git replay that undoes the changes
introduced by the specified commits. Like --onto and --advance, --revert
is a standalone mode: it takes a branch argument and updates that branch
with the newly created revert commits.
At GitLab, we need this in Gitaly for reverting commits directly on bare
repositories without requiring a working tree checkout.
The approach is the same as sequencer.c's do_pick_commit() -- cherry-pick
and revert are just the same three-way merge with swapped arguments:
- Cherry-pick: merge(ancestor=parent, ours=current, theirs=commit)
- Revert: merge(ancestor=commit, ours=current, theirs=parent)
We swap the base and pickme trees passed to merge_incore_nonrecursive()
to reverse the diff direction.
Revert commit messages follow the usual git revert conventions: prefixed
with "Revert" (or "Reapply" when reverting a revert), and including
"This reverts commit <hash>.". The author is set to the current user
rather than preserving the original author, matching git revert behavior.
Helped-by: Christian Couder <christian.couder@gmail.com >
Helped-by: Patrick Steinhardt <ps@pks.im >
Helped-by: Elijah Newren <newren@gmail.com >
Helped-by: Phillip Wood <phillip.wood123@gmail.com >
Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de >
Helped-by: Junio C Hamano <gitster@pobox.com >
Signed-off-by: Siddharth Asthana <siddharthasthana31@gmail.com >
Signed-off-by: Junio C Hamano <gitster@pobox.com >
2026-02-20 09:31:18 -08:00
..
2026-02-05 15:41:58 -08:00
2025-11-06 09:58:56 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:03 -07:00
2026-02-09 12:09:10 -08:00
2025-12-05 14:49:56 +09:00
2025-01-21 12:56:10 -08:00
2025-07-07 13:45:00 -07:00
2025-07-07 13:45:00 -07:00
2026-01-09 06:15:31 -08:00
2025-10-15 09:11:08 -07:00
2025-03-01 10:26:15 -08:00
2025-04-16 07:30:30 -07:00
2025-08-26 15:46:03 -07:00
2025-10-15 10:29:34 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-11-17 09:31:59 -08:00
2025-07-29 08:52:45 -07:00
2025-08-11 14:16:03 -07:00
2025-06-18 13:53:34 -07:00
2025-11-17 09:31:59 -08:00
2023-05-05 14:28:03 -07:00
2024-07-23 11:02:52 -07:00
2025-01-21 12:56:06 -08:00
2025-11-19 15:00:42 -08:00
2025-04-16 07:30:29 -07:00
2025-08-25 14:22:02 -07:00
2026-01-12 06:55:41 -08:00
2024-12-07 07:52:13 +09:00
2025-10-21 14:35:44 -07:00
2025-12-05 14:49:57 +09:00
2025-01-21 12:56:06 -08:00
2025-07-07 06:41:11 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-10-28 15:41:42 -07:00
2026-01-09 06:15:53 -08:00
2025-05-05 10:48:07 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2025-08-11 14:16:04 -07:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-12-20 14:55:43 +09:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-10-15 10:29:32 -07:00
2025-06-01 17:20:16 -07:00
2025-10-22 10:40:11 -07:00
2025-01-21 12:56:06 -08:00
2025-11-14 08:56:35 -08:00
2026-01-21 16:16:28 -08:00
2025-10-14 13:40:54 -07:00
2025-01-21 12:56:06 -08:00
2025-02-14 17:53:47 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-03-10 09:58:06 -07:00
2025-05-12 09:25:26 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-03-03 08:17:47 -08:00
2025-01-21 12:56:06 -08:00
2025-05-22 14:20:11 -07:00
2025-08-11 14:16:04 -07:00
2025-07-09 16:08:29 -07:00
2025-11-26 08:43:44 -08:00
2025-01-21 12:56:06 -08:00
2025-11-19 15:00:37 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2025-08-25 14:22:02 -07:00
2025-01-21 12:56:06 -08:00
2025-09-02 08:21:26 -07:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2026-01-13 05:41:17 -08:00
2025-01-21 12:56:06 -08:00
2025-02-14 17:53:49 -08:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-07-22 08:49:15 -07:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-09-10 13:34:58 -07:00
2025-01-21 12:56:06 -08:00
2025-08-22 11:12:27 -07:00
2026-01-20 14:13:04 -08:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-11-10 09:28:48 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-10-10 12:51:46 -07:00
2025-07-14 11:19:28 -07:00
2025-01-21 12:56:06 -08:00
2025-05-27 07:51:01 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-10-15 10:29:33 -07:00
2025-04-14 14:43:52 -07:00
2025-01-21 12:56:06 -08:00
2025-05-27 15:31:08 -07:00
2025-08-11 14:16:03 -07:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-09-19 10:02:56 -07:00
2026-01-09 06:08:37 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-12-14 17:04:37 +09:00
2025-11-19 15:00:45 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2025-08-11 14:16:04 -07:00
2025-12-28 17:36:16 +09:00
2025-05-20 11:43:36 -07:00
2025-08-06 07:36:30 -07:00
2025-10-02 12:26:12 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-12-21 11:33:10 +09:00
2025-12-20 14:55:43 +09:00
2025-01-21 12:56:06 -08:00
2026-02-20 09:31:18 -08:00
2025-12-30 12:58:19 +09:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2026-01-06 08:10:14 +09:00
2025-08-04 08:10:33 -07:00
2025-01-21 12:56:06 -08:00
2025-10-22 11:38:58 -07:00
2025-01-21 12:56:06 -08:00
2025-04-14 14:43:52 -07:00
2025-12-28 17:36:16 +09:00
2025-08-11 14:16:04 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-10-10 07:56:09 -07:00
2025-01-21 12:56:06 -08:00
2025-02-14 17:53:47 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-10-28 10:29:09 -07:00
2025-12-21 11:33:10 +09:00
2025-10-05 16:09:03 -07:00
2025-12-21 11:33:10 +09:00
2025-05-27 15:31:05 -07:00
2025-08-25 14:22:02 -07:00
2025-08-11 14:16:03 -07:00
2025-07-28 14:24:03 -07:00
2025-01-21 12:56:06 -08:00
2025-10-28 10:29:09 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2026-01-23 13:34:35 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:04 -07:00
2025-05-12 09:25:27 -07:00
2025-05-12 09:25:27 -07:00
2025-05-12 09:25:27 -07:00
2025-05-12 09:25:27 -07:00
2025-04-07 14:39:27 -07:00
2025-01-21 12:56:06 -08:00
2025-09-17 13:47:24 -07:00
2026-02-09 12:09:10 -08:00
2025-05-12 09:25:26 -07:00
2025-10-14 13:40:54 -07:00
2025-03-10 09:58:06 -07:00
2025-11-04 09:25:51 -08:00
2025-01-21 12:56:06 -08:00
2025-10-15 10:29:35 -07:00
2025-01-21 12:56:06 -08:00
2025-12-03 00:17:07 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2026-01-16 12:40:27 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-10-09 17:46:14 -07:00
2025-10-09 17:46:14 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-12-08 22:20:14 +09:00
2025-10-29 09:17:21 -07:00
2025-10-14 13:40:53 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-03-10 09:58:06 -07:00
2025-11-06 09:45:38 -08:00
2025-01-21 12:56:06 -08:00
2025-09-08 10:30:54 -07:00
2025-07-14 11:19:22 -07:00
2025-03-05 07:25:11 -08:00
2025-01-21 12:56:06 -08:00
2025-08-11 14:16:03 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-03-10 09:58:06 -07:00
2025-08-11 14:16:03 -07:00
2025-01-21 12:56:06 -08:00
2025-11-12 12:21:15 -08:00
2025-02-14 17:53:47 -08:00
2025-01-21 12:56:06 -08:00
2025-07-07 13:45:00 -07:00
2025-07-07 13:45:00 -07:00
2025-08-11 14:16:03 -07:00
2025-08-11 14:16:04 -07:00
2022-10-25 15:44:19 -07:00
2026-01-21 08:26:00 -08:00
2022-08-04 14:12:23 -07:00
2025-01-21 12:56:06 -08:00
2025-12-05 14:49:56 +09:00
2023-05-10 10:23:29 -07:00
2025-11-19 15:00:42 -08:00
2025-05-27 07:51:00 -07:00
2026-01-13 05:41:17 -08:00
2026-01-12 12:24:02 -08:00
2025-06-25 14:07:35 -07:00
2025-01-21 12:56:06 -08:00
2025-09-19 10:02:56 -07:00
2025-10-15 10:29:35 -07:00
2025-10-05 16:10:53 -07:00
2025-11-24 10:55:48 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-05-27 07:50:59 -07:00
2025-07-07 13:45:00 -07:00
2026-01-20 09:38:56 -08:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-12-16 09:42:44 +09:00
2025-01-21 12:56:06 -08:00
2025-12-19 21:51:01 +09:00
2025-11-04 07:48:06 -08:00
2025-03-10 09:58:06 -07:00
2025-01-21 12:56:06 -08:00
2025-01-21 12:56:06 -08:00
2025-11-19 15:00:42 -08:00
2025-01-21 12:56:06 -08:00
2025-07-23 08:15:18 -07:00