Re: [PATCH RFC v2 03/16] sequencer: introduce new history editing mode
- From
D. Ben Knoble <ben.knoble@gmail.com>
- Date
- Aug 26, 2025, 12:55 UTC
- Message-ID
- <CALnO6CBgGNdD7eRsseXVmTCkfi9TU6S46MckC6her0FzJNa=Wg@mail.gmail.com>
- In-Reply-To
- <20250824-b4-pks-history-builtin-v2-3-964ac12f65bd@pks.im>
On Sun, Aug 24, 2025 at 1:42 PM Patrick Steinhardt <ps@pks.im> wrote:
Show 23 quoted lines
> diff --git a/sequencer.c b/sequencer.c
> index bff181df76..898ac1a2a8 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -3052,17 +3087,29 @@ static int read_populate_todo(struct repository *r,
> return error(_("no commits parsed."));
>
> if (!is_rebase_i(opts)) {
> - enum todo_command valid =
> - opts->action == REPLAY_PICK ? TODO_PICK : TODO_REVERT;
> + enum todo_command valid;
> int i;
>
> - for (i = 0; i < todo_list->nr; i++)
> + switch (opts->action) {
> + case REPLAY_PICK:
> + case REPLAY_HISTORY_EDIT:
> + valid = TODO_PICK;
> + break;
> + default:
> + valid = TODO_REVERT;
> + break;
> + }I think I see this hunk repeated in a few places—maybe some leftoverbits for a refactor?
-- D. Ben Knoble