Re: [PATCH 0/1] replay: add --revert option to reverse commit changes
- From
Siddharth Asthana <siddharthasthana31@gmail.com>
- Date
- Nov 27, 2025, 19:21 UTC
- Message-ID
- <fa403239-cae3-463b-8c62-8761116ec652@gmail.com>
- In-Reply-To
- <xmqqcy54mro6.fsf@gitster.g>
On 27/11/25 02:34, Junio C Hamano wrote:
Show 14 quoted lines
> Siddharth Asthana <siddharthasthana31@gmail.com> writes: > >> 1. For quick undoing an entire MR, the `merge-tree` approach you >> suggest is indeed more efficient and avoids unnecessary intermediate >> conflicts. >> >> 2. For commit-by-commit reverts, we need individual revert commits with >> proper attribution (which commit is being reverted) for auditability and >> history clarity. This is particularly useful when only specific commits >> from a merged branch need to be reverted. > These are both good workflows with appropriate uses. To make the > tool useful for #2, it needs to be able to allow "I have merged a > topic with 7 commits, but the first commit and the fourth commit are > faulty and I need to revert them", i.e., not just a range
Since replay uses the same rev-list machinery as `git log`, users can already specify disconnected commits:
git replay --revert <target> <commit1> <commit4>
I will add a test to verify this works and document the capability.
Thanks, Siddharth
Show 7 quoted lines
> (like > "rebase" and "cherry-pick" workflows take), but a set of commits > that are potentially disconnected. The current command line > arguments "git replay" supports, or "git revert A..B" for that > matter, are not exactly a good fit for such a use case, although the > user can of course run two single-commit revert operations in a row. >