From: Junio C Hamano Date: Wed, 25 Mar 2026 06:29:59 GMT Subject: Re: [PATCH v5 2/2] replay: add --revert mode to reverse commit changes Message-ID: In-Reply-To: <20260324220401.47040-3-siddharthasthana31@gmail.com> Siddharth Asthana 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. > repo_init_revisions(repo, &revs, prefix);