Re: [PATCH 0/1] replay: add --revert option to reverse commit changes
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 27, 2025, 20:17 UTC
- Message-ID
- <xmqqsedzjkls.fsf@gitster.g>
- In-Reply-To
- <fa403239-cae3-463b-8c62-8761116ec652@gmail.com>
Siddharth Asthana <siddharthasthana31@gmail.com> writes:
Show 10 quoted lines
>> 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>
Ah, OK.
Yes, you can use setup_revisions() command line parsing, intercept the result of parsing before prepare_revilimit_list() reduces that to a contiguous set of commits that are reachable from some of the positive refs and are not reachable from any of the negative ones, so it certainly is doable.