aboutsummaryrefslogtreecommitdiffstats
path: root/sequencer.h
diff options
context:
space:
mode:
authorAlban Gruin <alban.gruin@gmail.com>2018-08-28 14:10:36 +0200
committerJunio C Hamano <gitster@pobox.com>2018-08-29 13:38:18 -0700
commitb97e187364990fb8410355ff8b4365d0e37bbbbe (patch)
tree73e0346e20435cb289e56cf2c59e269339c74b43 /sequencer.h
parentd078c39106895b26512ca6b259d66fe64b274e1b (diff)
downloadgit-b97e187364990fb8410355ff8b4365d0e37bbbbe.tar.gz
rebase -i: rewrite complete_action() in C
This rewrites complete_action() from shell to C. A new mode is added to rebase--helper (`--complete-action`), as well as a new flag (`--autosquash`). Finally, complete_action() is stripped from git-rebase--interactive.sh. The original complete_action() would return the code 2 when the todo list contained no actions. This was a special case for rebase -i and -p; git-rebase.sh would then apply the autostash, delete the state directory, and die with the message "Nothing to do". This cleanup is rewritten in C instead of returning 2. As rebase -i no longer returns 2, the comment describing this behaviour in git-rebase.sh is updated to reflect this change. The message "Nothing to do" is now printed with error(), and so becomes "error: nothing to do". Some tests in t3404 check this value, so they are updated to fit this change. The first check might seem useless as we write "noop" to the todo list if it is empty. Actually, the todo list might contain commented commands (ie. empty commits). In this case, complete_action() won’t write "noop", and will abort without starting the editor. Signed-off-by: Alban Gruin <alban.gruin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.h')
-rw-r--r--sequencer.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sequencer.h b/sequencer.h
index fcbcd246c2..d58766c6d7 100644
--- a/sequencer.h
+++ b/sequencer.h
@@ -92,6 +92,10 @@ int transform_todos(unsigned flags);
enum missing_commit_check_level get_missing_commit_check_level(void);
int check_todo_list(void);
int skip_unnecessary_picks(struct object_id *output_oid);
+int complete_action(struct replay_opts *opts, unsigned flags,
+ const char *shortrevisions, const char *onto_name,
+ const char *onto, const char *orig_head, const char *cmd,
+ unsigned autosquash);
int rearrange_squash(void);
extern const char sign_off_header[];