To prevent mistakes when editing a branch, rebase features a knob, rebase.missingCommitsCheck, to warn the user if a commit was dropped. Unfortunately, this check is only effective for the initial edit, which means that if you edit the todo list at a later point of the rebase and dropped a commit, no warnings or errors would be issued. This adds the ability to check if commits were dropped when resuming a rebase (with `rebase --continue'), when editing the todo list (with `rebase --edit-todo'), or when reloading the todo list after an `exec' command. The idea to extend this feature was suggested to me more than a year ago by Phillip Wood, if I'm not mistaken. I postponed this until four month ago, when ag/sequencer-reduce-rewriting-todo finally hit master, but I had to stop because of other obligations. I could go back to work one month ago, when I did the bulk of this series, but I lacked time to polish it, so it waited a bit more. Now, I think it is in a good shape to be sent, although it is still RFC-quality to me. The advertised functionality should work well, but perhaps there is some flaws I missed. The first two patches are new tests, demonstrating that after the initial edit, the check is not done. The next four are what could be qualified as omissions from ag/sequencer-reduce-rewriting-todo, but they are quite important (IMHO) for the rest of the series. The last three actually extend rebase.missingCommitsCheck. This is based on master (9d418600f4, "The fifth batch"). The tip of this series is tagged as "edit-todo-drop-rfc" in https://github.com/agrn/git. Alban Gruin (9): t3404: demonstrate that --edit-todo does not check for dropped commits t3429: demonstrate that rebase exec does not check for dropped commits sequencer: update `total_nr' when adding an item to a todo list sequencer: update `done_nr' when skipping commands in a todo list sequencer: move the code writing total_nr on the disk to a new function sequencer: add a parameter to sequencer_continue() to accept a todo list rebase-interactive: todo_list_check() also uses the done list rebase-interactive: warn if commit is dropped with --edit-todo sequencer: have read_populate_todo() check for dropped commits builtin/rebase.c | 2 +- builtin/revert.c | 2 +- rebase-interactive.c | 67 +++++++++++++++++++++++----- rebase-interactive.h | 6 ++- sequencer.c | 53 ++++++++++++++-------- sequencer.h | 3 +- t/t3404-rebase-interactive.sh | 82 +++++++++++++++++++++++++++++++++++ t/t3429-rebase-edit-todo.sh | 44 ++++++++++++++++++- 8 files changed, 224 insertions(+), 35 deletions(-) -- 2.22.0