Re: [PATCH 1/1] replay: add --revert option to reverse commit changes
- From
Siddharth Asthana <siddharthasthana31@gmail.com>
- Date
- Nov 26, 2025, 19:28 UTC
- Message-ID
- <515c997f-f562-4081-9c44-5a3049d75121@gmail.com>
- In-Reply-To
- <xmqqjyzdrjf1.fsf@gitster.g>
On 26/11/25 01:09, Junio C Hamano wrote:
Show 43 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>>> Dedup with do_pick_commit() where this was taken from. Possibly in
>>> a separte patch before the main one.
>> Forgot to attach this at the end. What I meant was that something
>> along this line may be a good starting point.
>>
>> sequencer.c | 14 +-------------
>> 1 file changed, 1 insertion(+), 13 deletions(-)
>>
>> diff --git c/sequencer.c w/sequencer.c
>> index e6d82c8368..29909952d4 100644
>> --- c/sequencer.c
>> +++ w/sequencer.c
>> @@ -2365,20 +2365,8 @@ static int do_pick_commit(struct repository *r,
>> if (opts->commit_use_reference) {
>> strbuf_commented_addf(&ctx->message, comment_line_str,
>> "*** SAY WHY WE ARE REVERTING ON THE TITLE LINE ***");
>> - } else if (skip_prefix(msg.subject, "Revert \"", &orig_subject) &&
>> - /*
>> - * We don't touch pre-existing repeated reverts, because
>> - * theoretically these can be nested arbitrarily deeply,
>> - * thus requiring excessive complexity to deal with.
>> - */
>> - !starts_with(orig_subject, "Revert \"")) {
>> - strbuf_addstr(&ctx->message, "Reapply \"");
>> - strbuf_addstr(&ctx->message, orig_subject);
>> - strbuf_addstr(&ctx->message, "\n");
>> } else {
>> - strbuf_addstr(&ctx->message, "Revert \"");
>> - strbuf_addstr(&ctx->message, msg.subject);
>> - strbuf_addstr(&ctx->message, "\"\n");
>> + sequencer_format_revert_header(&ctx->message, msg.subject);
>> }
>> strbuf_addstr(&ctx->message, "\nThis reverts commit ");
>> refer_to_commit(opts, &ctx->message, commit);
> By the way, I probably would not be queuing this version today, as
> this has obvious conflict with a large code movement made by
> Patrick's "history" series, which itself is expecting a reroll.
>
> Perhaps collect review comments on this iteration a bit more and
> wait for that other topic to be rerolled, and if it turns out to be
> solid enough, base a v2 of this patch on top of it?Understood. I will wait for Patrick's "history" series to be rerolled and base v2 on top of that to avoid conflicts. In the meantime, I will address all the review feedback locally.
Thanks, Siddharth
> > Thanks.