Re: [PATCH v2 02/10] sequencer: move definition of is_final_fixup()
- From
Andrei Rybak <rybak.a.v@gmail.com>
- Date
- Jul 14, 2026, 22:50 UTC
- Message-ID
- <20260714225056.2285055-1-rybak.a.v@gmail.com>
- In-Reply-To
- <02670f57e7d81d4ff7341fecff3ef04b9fdc0102.1783948637.git.phillip.wood@dunelm.org.uk>
Show 35 quoted lines
> Move this function earlier in the file in preparation for adding a
> new caller in a later commit.
>
> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
> ---
> sequencer.c | 30 +++++++++++++++---------------
> 1 file changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/sequencer.c b/sequencer.c
> index 57855b0066a..32a09b6e87d 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -4627,21 +4627,6 @@ static int do_update_refs(struct repository *r, int quiet)
> strbuf_release(&update_msg);
> strbuf_release(&error_msg);
> return res;
> -}
> -
> -static int is_final_fixup(struct todo_list *todo_list)
> -{
> - int i = todo_list->current;
> -
> - if (!is_fixup(todo_list->items[i].command))
> - return 0;
> -
> - while (++i < todo_list->nr)
> - if (is_fixup(todo_list->items[i].command))
> - return 0;
> - else if (!is_noop(todo_list->items[i].command))
> - break;
> - return 1;
> }
>
> static enum todo_command peek_command(struct todo_list *todo_list, int offset)
> @@ -4925,6 +4910,21 @@ static int reread_todo_if_changed(struct repository *r,4910 is greater than 4627, the function is_final_fixup() seems to have been moved _later_ in the file. But the commit message says "Move this function earlier in the file". Am I missing something?
Show 23 quoted lines
> strbuf_release(&buf);
>
> return 0;
> +}
> +
> +static int is_final_fixup(struct todo_list *todo_list)
> +{
> + int i = todo_list->current;
> +
> + if (!is_fixup(todo_list->items[i].command))
> + return 0;
> +
> + while (++i < todo_list->nr)
> + if (is_fixup(todo_list->items[i].command))
> + return 0;
> + else if (!is_noop(todo_list->items[i].command))
> + break;
> + return 1;
> }
>
> static const char rescheduled_advice[] =
> --
> 2.54.0.200.gfd8d68259e3