3 #include "rebase-interactive.h"
7 int append_todo_help(unsigned edit_todo
, unsigned keep_empty
)
9 struct strbuf buf
= STRBUF_INIT
;
12 const char *msg
= _("\nCommands:\n"
13 "p, pick <commit> = use commit\n"
14 "r, reword <commit> = use commit, but edit the commit message\n"
15 "e, edit <commit> = use commit, but stop for amending\n"
16 "s, squash <commit> = use commit, but meld into previous commit\n"
17 "f, fixup <commit> = like \"squash\", but discard this commit's log message\n"
18 "x, exec <command> = run command (the rest of the line) using shell\n"
19 "d, drop <commit> = remove commit\n"
20 "l, label <label> = label current HEAD with a name\n"
21 "t, reset <label> = reset HEAD to a label\n"
22 "m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
23 ". create a merge commit using the original merge commit's\n"
24 ". message (or the oneline, if no original merge commit was\n"
25 ". specified). Use -c <commit> to reword the commit message.\n"
27 "These lines can be re-ordered; they are executed from top to bottom.\n");
29 todo
= fopen_or_warn(rebase_path_todo(), "a");
33 strbuf_add_commented_lines(&buf
, msg
, strlen(msg
));
35 if (get_missing_commit_check_level() == MISSING_COMMIT_CHECK_ERROR
)
36 msg
= _("\nDo not remove any line. Use 'drop' "
37 "explicitly to remove a commit.\n");
39 msg
= _("\nIf you remove a line here "
40 "THAT COMMIT WILL BE LOST.\n");
42 strbuf_add_commented_lines(&buf
, msg
, strlen(msg
));
45 msg
= _("\nYou are editing the todo file "
46 "of an ongoing interactive rebase.\n"
47 "To continue rebase after editing, run:\n"
48 " git rebase --continue\n\n");
50 msg
= _("\nHowever, if you remove everything, "
51 "the rebase will be aborted.\n\n");
53 strbuf_add_commented_lines(&buf
, msg
, strlen(msg
));
56 msg
= _("Note that empty commits are commented out");
57 strbuf_add_commented_lines(&buf
, msg
, strlen(msg
));
60 ret
= fputs(buf
.buf
, todo
);
62 error_errno(_("could not append help text to '%s'"), rebase_path_todo());