Re: [PATCH v2 20/34] sequencer (rebase -i): copy commit notes at end
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 2, 2017, 14:51 UTC
- Message-ID
- <alpine.DEB.2.20.1701021545450.3469@virtualbox>
- In-Reply-To
- <xmqqvaujr7ed.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Fri, 16 Dec 2016, Junio C Hamano wrote:
Show 18 quoted lines
> Johannes Schindelin <johannes.schindelin@gmx.de> writes:
>
> > @@ -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