rebase -i: rewrite append_todo_help() in C

This rewrites append_todo_help() from shell to C. It also incorporates
some parts of initiate_action() and complete_action() that also write
help texts to the todo file.

This also introduces the source file rebase-interactive.c. This file
will contain functions necessary for interactive rebase that are too
specific for the sequencer, and is part of libgit.a.

Two flags are added to rebase--helper.c: one to call
append_todo_help() (`--append-todo-help`), and another one to tell
append_todo_help() to write the help text suited for the edit-todo
mode (`--write-edit-todo`).

Finally, append_todo_help() is removed from git-rebase--interactive.sh
to use `rebase--helper --append-todo-help` instead.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Alban Gruin
2018-08-10 18:51:29 +02:00
committed by Junio C Hamano
parent 44b776c3e9
commit 145e05ac44
5 changed files with 86 additions and 52 deletions

6
rebase-interactive.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef REBASE_INTERACTIVE_H
#define REBASE_INTERACTIVE_H
int append_todo_help(unsigned edit_todo, unsigned keep_empty);
#endif