struct string_list whitespace = STRING_LIST_INIT_NODUP;
struct string_list exec = STRING_LIST_INIT_NODUP;
const char *rebase_merges = NULL;
+ int fork_point = -1;
struct option builtin_rebase_options[] = {
OPT_STRING(0, "onto", &options.onto_name,
N_("revision"),
N_("mode"),
N_("try to rebase merges instead of skipping them"),
PARSE_OPT_OPTARG, NULL, (intptr_t)""},
+ OPT_BOOL(0, "fork-point", &fork_point,
+ N_("use 'merge-base --fork-point' to refine upstream")),
OPT_END(),
};
} else
BUG("unexpected number of arguments left to parse");
+ if (fork_point > 0) {
+ struct commit *head =
+ lookup_commit_reference(the_repository,
+ &options.orig_head);
+ options.restrict_revision =
+ get_fork_point(options.upstream_name, head);
+ }
+
if (read_index(the_repository->index) < 0)
die(_("could not read index"));