From: Toon Claes Date: Mon, 23 Feb 2026 11:23:55 GMT Subject: Re: [PATCH v3 2/2] replay: add --revert mode to reverse commit changes Message-ID: <87pl5vem9g.fsf@iotcl.com> In-Reply-To: Christian Couder writes: > On Fri, Feb 20, 2026 at 6:35 PM Toon Claes wrote: >> >> The modes `--onto`, `--advance` and `--revert` seem to be extremely >> different from each other. So I'm starting to wonder whether it won't >> make more sense to instead create subcommands instead of options for >> these. Maybe something like: >> >> git replay revert --base= >> git replay pick --base= >> git replay replay --base= > > (I think you mean `git replay rebase` in the above line, no?) I'm fine either way, but I agree saying "replay" twice looks weird. > I agree that we should consider this. But I think we should do it > separately in another series, after this one about --revert is merged. > We might even consider waiting until we have more experience using > `git replay --revert` to make a more informed decision. We shouldn't > wait for too long either though... I can agree with that. > Also if we nearly always need a base, then why not: > > git replay rebase > git replay pick > git replay revert > > ? > > Or what was the reason for introducing --base=? Well, the modes 'revert' and 'pick' work different from 'replay'. The latter looks in to determine which refs need updating. This can lead to multiple refs that will be updated (with option --contained). The first two only operate on one ref and ignore whatever refs are in . (I think, correct me if I'm wrong) That's why I suggest to take it one step further: git replay revert --ref= git replay pick --ref= git replay rebase --onto= That's why the first two use --ref instead of --onto. As a benefit, this also enables me to address another issue I have: git-replay(1) cannot be used on bare commit IDs. This issue was also raised by Yee Cheng Chin[1]. With options `--onto` and `--ref` we can fix this. Because you can use them together: git replay replay --ref=ref/heads/branch --onto=112233 aabbcc..ddeeff git replay pick --ref=ref/heads/branch --onto=112233 aabbcc..ddeeff git replay rebase --ref=ref/heads/branch --onto=112233 aabbcc..ddeeff The value of --onto doesn't need to be a ref, but --ref needs. For the 'rebase' subcommand option --ref is optional, for the other two --onto is optional. And when one of both is omitted, one defaults to the other. What do you think? [1]: https://lore.kernel.org/git/CAHTeOx-SMLh_idKhGczPKzZNOKy04uYXmUhL8Z79yRuNpmE4eA@mail.gmail.com/ -- Cheers, Toon