Subject: Re: [PATCH v5 2/2] replay: add --revert mode to reverse commit changes

From: Siddharth Asthana <[email-masked]>
Date: Wed, 25 Mar 2026 21:06:38 +0530

On 25/03/26 11:59, Junio C Hamano wrote:
> Siddharth Asthana <[email-masked]> writes:
> 
>> diff --git a/builtin/replay.c b/builtin/replay.c
>> index 2cdde830a8..d3c1d920f0 100644
>> --- a/builtin/replay.c
>> +++ b/builtin/replay.c
>> @@ -83,7 +83,7 @@ int cmd_replay(int argc,
>> ...
>>   	/* Parse ref action mode from command line or config */
>>   	ref_mode = get_ref_action_mode(repo, ref_action);
>>   
>> +	/*
>> +	 * Cherry-pick/rebase need oldest-first ordering so that each
>> +	 * replayed commit can build on its already-replayed parent.
>> +	 * Revert needs newest-first ordering (like git revert) to
>> +	 * reduce conflicts by peeling off changes from the top.
>> +	 */
>> +	int desired_reverse = !opts.revert;
>> +
> 
> Compiler notices -Werror=declaration-after-statement error here.

Ah right, I should have caught that. I have moved the declaration to the 
top of cmd_replay() with other variables and the CI is passing now [1]. 
Will send a v6.

[1] https://gitlab.com/gitlab-org/git/-/pipelines/2406607541

Thanks,
Siddharth

> 
>>   	repo_init_revisions(repo, &revs, prefix);