Re: [PATCH v2 20/34] sequencer (rebase -i): copy commit notes at end
From: Johannes Schindelin <hidden>
Date: 2017-01-02 14:51:24
Hi Junio, On Fri, 16 Dec 2016, Junio C Hamano wrote:
Johannes Schindelin [off-list ref] writes:quoted
@@ -1750,6 +1797,17 @@ static int is_final_fixup(struct todo_list *todo_list) return 1; } +static enum todo_command peek_command(struct todo_list *todo_list, int offset) +{ + int i; + + for (i = todo_list->current + offset; i < todo_list->nr; i++) + if (todo_list->items[i].command != TODO_NOOP) + return todo_list->items[i].command;Makes me wonder, after having commented on 07/34 regarding the fact that in the end you would end up having three variants of no-op (i.e. NOOP, DROP and COMMENT), what definition of a "command" this function uses to return its result, when asked to "peek".
Well, it uses the todo_command idea of a "command"... ;-) The only thing we do with this for now is to look whether the next command is a fixup/squash (so that the user gets to edit the commit message just once, for example, and also to record rewritten commits properly).
I suspect that this will be updated in a later patch to do "< TODO_NOOP" instead?
Actually, no. I introduced a new function is_noop() and that is used now. Ciao, Dscho