From c8bae7493d2f2910b57f13ded012e86bdcfb0532 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 16:47:53 +0200 Subject: Adding upstream version 1:2.39.2. Signed-off-by: Daniel Baumann --- rebase-interactive.c | 237 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 rebase-interactive.c (limited to 'rebase-interactive.c') diff --git a/rebase-interactive.c b/rebase-interactive.c new file mode 100644 index 0000000..7407c59 --- /dev/null +++ b/rebase-interactive.c @@ -0,0 +1,237 @@ +#include "cache.h" +#include "commit.h" +#include "sequencer.h" +#include "rebase-interactive.h" +#include "strbuf.h" +#include "commit-slab.h" +#include "config.h" +#include "dir.h" + +static const char edit_todo_list_advice[] = +N_("You can fix this with 'git rebase --edit-todo' " +"and then run 'git rebase --continue'.\n" +"Or you can abort the rebase with 'git rebase" +" --abort'.\n"); + +enum missing_commit_check_level { + MISSING_COMMIT_CHECK_IGNORE = 0, + MISSING_COMMIT_CHECK_WARN, + MISSING_COMMIT_CHECK_ERROR +}; + +static enum missing_commit_check_level get_missing_commit_check_level(void) +{ + const char *value; + + if (git_config_get_value("rebase.missingcommitscheck", &value) || + !strcasecmp("ignore", value)) + return MISSING_COMMIT_CHECK_IGNORE; + if (!strcasecmp("warn", value)) + return MISSING_COMMIT_CHECK_WARN; + if (!strcasecmp("error", value)) + return MISSING_COMMIT_CHECK_ERROR; + warning(_("unrecognized setting %s for option " + "rebase.missingCommitsCheck. Ignoring."), value); + return MISSING_COMMIT_CHECK_IGNORE; +} + +void append_todo_help(int command_count, + const char *shortrevisions, const char *shortonto, + struct strbuf *buf) +{ + const char *msg = _("\nCommands:\n" +"p, pick = use commit\n" +"r, reword = use commit, but edit the commit message\n" +"e, edit = use commit, but stop for amending\n" +"s, squash = use commit, but meld into previous commit\n" +"f, fixup [-C | -c] = like \"squash\" but keep only the previous\n" +" commit's log message, unless -C is used, in which case\n" +" keep only this commit's message; -c is same as -C but\n" +" opens the editor\n" +"x, exec = run command (the rest of the line) using shell\n" +"b, break = stop here (continue rebase later with 'git rebase --continue')\n" +"d, drop = remove commit\n" +"l, label