]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/rebase.c
pull: don't warn if pull.ff has been set
[thirdparty/git.git] / builtin / rebase.c
index 1c0a49c6425b4872b06018d3b1ca179d12e651e3..37ba76ac3d26f86ef3c16b65d2293b873efd8ee5 100644 (file)
@@ -477,10 +477,10 @@ int cmd_rebase__interactive(int argc, const char **argv, const char *prefix)
        struct option options[] = {
                OPT_NEGBIT(0, "ff", &opts.flags, N_("allow fast-forward"),
                           REBASE_FORCE),
-               { OPTION_CALLBACK, 'k', "keep-empty", &options, NULL,
+               OPT_CALLBACK_F('k', "keep-empty", &options, NULL,
                        N_("keep commits which start empty"),
                        PARSE_OPT_NOARG | PARSE_OPT_HIDDEN,
-                       parse_opt_keep_empty },
+                       parse_opt_keep_empty),
                OPT_BOOL_F(0, "allow-empty-message", &opts.allow_empty_message,
                           N_("allow commits with empty messages"),
                           PARSE_OPT_HIDDEN),
@@ -722,7 +722,6 @@ static int rebase_write_basic_state(struct rebase_options *opts)
 static int finish_rebase(struct rebase_options *opts)
 {
        struct strbuf dir = STRBUF_INIT;
-       const char *argv_gc_auto[] = { "gc", "--auto", NULL };
        int ret = 0;
 
        delete_ref(NULL, "REBASE_HEAD", NULL, REF_NO_DEREF);
@@ -732,7 +731,7 @@ static int finish_rebase(struct rebase_options *opts)
         * We ignore errors in 'gc --auto', since the
         * user should see them.
         */
-       run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
+       run_auto_gc(!(opts->flags & (REBASE_NO_QUIET|REBASE_VERBOSE)));
        if (opts->type == REBASE_MERGE) {
                struct replay_opts replay = REPLAY_OPTS_INIT;
 
@@ -1351,18 +1350,18 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
                OPT_CMDMODE(0, "show-current-patch", &action,
                            N_("show the patch file being applied or merged"),
                            ACTION_SHOW_CURRENT_PATCH),
-               { OPTION_CALLBACK, 0, "apply", &options, NULL,
+               OPT_CALLBACK_F(0, "apply", &options, NULL,
                        N_("use apply strategies to rebase"),
                        PARSE_OPT_NOARG | PARSE_OPT_NONEG,
-                       parse_opt_am },
-               { OPTION_CALLBACK, 'm', "merge", &options, NULL,
+                       parse_opt_am),
+               OPT_CALLBACK_F('m', "merge", &options, NULL,
                        N_("use merging strategies to rebase"),
                        PARSE_OPT_NOARG | PARSE_OPT_NONEG,
-                       parse_opt_merge },
-               { OPTION_CALLBACK, 'i', "interactive", &options, NULL,
+                       parse_opt_merge),
+               OPT_CALLBACK_F('i', "interactive", &options, NULL,
                        N_("let the user edit the list of commits to rebase"),
                        PARSE_OPT_NOARG | PARSE_OPT_NONEG,
-                       parse_opt_interactive },
+                       parse_opt_interactive),
                OPT_SET_INT_F('p', "preserve-merges", &options.type,
                              N_("(DEPRECATED) try to recreate merges instead of "
                                 "ignoring them"),
@@ -1371,10 +1370,10 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
                OPT_CALLBACK_F(0, "empty", &options, "{drop,keep,ask}",
                               N_("how to handle commits that become empty"),
                               PARSE_OPT_NONEG, parse_opt_empty),
-               { OPTION_CALLBACK, 'k', "keep-empty", &options, NULL,
+               OPT_CALLBACK_F('k', "keep-empty", &options, NULL,
                        N_("keep commits which start empty"),
                        PARSE_OPT_NOARG | PARSE_OPT_HIDDEN,
-                       parse_opt_keep_empty },
+                       parse_opt_keep_empty),
                OPT_BOOL(0, "autosquash", &options.autosquash,
                         N_("move commits that begin with "
                            "squash!/fixup! under -i")),
@@ -1481,6 +1480,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
                        die(_("cannot combine '--keep-base' with '--root'"));
        }
 
+       if (options.root && fork_point > 0)
+               die(_("cannot combine '--root' with '--fork-point'"));
+
        if (action != ACTION_NONE && !in_progress)
                die(_("No rebase in progress?"));
        setenv(GIT_REFLOG_ACTION_ENVIRONMENT, "rebase", 0);