MCPcopy Create free account
hub / github.com/git/git / append_todo_help

Function append_todo_help

rebase-interactive.c:45–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45void append_todo_help(int command_count,
46 const char *shortrevisions, const char *shortonto,
47 struct strbuf *buf)
48{
49 const char *msg = _("\nCommands:\n"
50"p, pick <commit> = use commit\n"
51"r, reword <commit> = use commit, but edit the commit message\n"
52"e, edit <commit> = use commit, but stop for amending\n"
53"s, squash <commit> = use commit, but meld into previous commit\n"
54"f, fixup [-C | -c] <commit> = like \"squash\" but keep only the previous\n"
55" commit's log message, unless -C is used, in which case\n"
56" keep only this commit's message; -c is same as -C but\n"
57" opens the editor\n"
58"x, exec <command> = run command (the rest of the line) using shell\n"
59"b, break = stop here (continue rebase later with 'git rebase --continue')\n"
60"d, drop <commit> = remove commit\n"
61"l, label <label> = label current HEAD with a name\n"
62"t, reset <label> = reset HEAD to a label\n"
63"m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
64" create a merge commit using the original merge commit's\n"
65" message (or the oneline, if no original merge commit was\n"
66" specified); use -c <commit> to reword the commit message\n"
67"u, update-ref <ref> = track a placeholder for the <ref> to be updated\n"
68" to this position in the new commits. The <ref> is\n"
69" updated at the end of the rebase\n"
70"\n"
71"These lines can be re-ordered; they are executed from top to bottom.\n");
72 unsigned edit_todo = !(shortrevisions && shortonto);
73
74 if (!edit_todo) {
75 strbuf_addch(buf, '\n');
76 strbuf_commented_addf(buf, comment_line_str,
77 Q_("Rebase %s onto %s (%d command)",
78 "Rebase %s onto %s (%d commands)",
79 command_count),
80 shortrevisions, shortonto, command_count);
81 }
82
83 strbuf_add_commented_lines(buf, msg, strlen(msg), comment_line_str);
84
85 if (get_missing_commit_check_level() == MISSING_COMMIT_CHECK_ERROR)
86 msg = _("\nDo not remove any line. Use 'drop' "
87 "explicitly to remove a commit.\n");
88 else
89 msg = _("\nIf you remove a line here "
90 "THAT COMMIT WILL BE LOST.\n");
91
92 strbuf_add_commented_lines(buf, msg, strlen(msg), comment_line_str);
93
94 if (edit_todo)
95 msg = _("\nYou are editing the todo file "
96 "of an ongoing interactive rebase.\n"
97 "To continue rebase after editing, run:\n"
98 " git rebase --continue\n\n");
99 else
100 msg = _("\nHowever, if you remove everything, "
101 "the rebase will be aborted.\n\n");
102

Callers 1

todo_list_write_to_fileFunction · 0.85

Calls 4

strbuf_addchFunction · 0.85
strbuf_commented_addfFunction · 0.85

Tested by

no test coverage detected