Re: [GSoC][PATCH v3 02/13] rebase--interactive: rewrite append_todo_help() in C
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 10, 2018, 17:56 UTC
- Message-ID
- <xmqq36wr7z4x.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20180710121557.6698-3-alban.gruin@gmail.com>
Alban Gruin <alban.gruin@gmail.com> writes:
Show 20 quoted lines
> 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> > --- > Unchanged from what have been queued on `pu` (ag/rebase-i-in-c), and > from v2.
With something like '...except downcasing an error message "Could not append..."', a comment like this is very much appreciated as it helps readers who have read the previous round and remember what was in there ;-)
Show 9 quoted lines
> + ...
> + if (get_missing_commit_check_level() == MISSING_COMMIT_CHECK_ERROR)
> + msg = _("\nDo not remove any line. Use 'drop' "
> + "explicitly to remove a commit.\n");
> + else
> + msg = _("\nIf you remove a line here "
> + "THAT COMMIT WILL BE LOST.\n");
> +
> + strbuf_add_commented_lines(&buf, msg, strlen(msg));Nice use of strbuf_add_comment_lines() function ;-).