git/builtin/rebase.c

/*
 * "git rebase" builtin command
 *
 * Copyright (c) 2018 Pratik Karki
 */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"

#include "abspath.h"
#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "run-command.h"
#include "strvec.h"
#include "dir.h"
#include "refs.h"
#include "config.h"
#include "unpack-trees.h"
#include "lockfile.h"
#include "object-file.h"
#include "object-name.h"
#include "parse-options.h"
#include "path.h"
#include "commit.h"
#include "diff.h"
#include "wt-status.h"
#include "revision.h"
#include "commit-reach.h"
#include "rerere.h"
#include "branch.h"
#include "sequencer.h"
#include "rebase-interactive.h"
#include "reset.h"
#include "trace2.h"
#include "hook.h"

static char const * const builtin_rebase_usage[] =;

static GIT_PATH_FUNC(path_squash_onto, "rebase-merge/squash-onto")
static GIT_PATH_FUNC(path_interactive, "rebase-merge/interactive")
static GIT_PATH_FUNC(apply_dir, "rebase-apply")
static GIT_PATH_FUNC(merge_dir, "rebase-merge")

enum rebase_type {};

enum empty_type {};

enum action {};

static const char *action_names[] =;

struct rebase_options {};

#define REBASE_OPTIONS_INIT

static void rebase_options_release(struct rebase_options *opts)
{}

static struct replay_opts get_replay_opts(const struct rebase_options *opts)
{}

static int edit_todo_file(unsigned flags, struct replay_opts *opts)
{}

static int get_revision_ranges(struct commit *upstream, struct commit *onto,
			       struct object_id *orig_head, char **revisions,
			       char **shortrevisions)
{}

static int init_basic_state(struct replay_opts *opts, const char *head_name,
			    struct commit *onto,
			    const struct object_id *orig_head)
{}

static int do_interactive_rebase(struct rebase_options *opts, unsigned flags)
{}

static int run_sequencer_rebase(struct rebase_options *opts)
{}

static int is_merge(struct rebase_options *opts)
{}

static void imply_merge(struct rebase_options *opts, const char *option)
{}

/* Returns the filename prefixed by the state_dir */
static const char *state_dir_path(const char *filename, struct rebase_options *opts)
{}

/* Initialize the rebase options from the state directory. */
static int read_basic_state(struct rebase_options *opts)
{}

static int rebase_write_basic_state(struct rebase_options *opts)
{}

static int cleanup_autostash(struct rebase_options *opts)
{}

static int finish_rebase(struct rebase_options *opts)
{}

static int move_to_original_branch(struct rebase_options *opts)
{}

static int run_am(struct rebase_options *opts)
{}

static int run_specific_rebase(struct rebase_options *opts)
{}

static void parse_rebase_merges_value(struct rebase_options *options, const char *value)
{}

static int rebase_config(const char *var, const char *value,
			 const struct config_context *ctx, void *data)
{}

static int checkout_up_to_date(struct rebase_options *options)
{}

/*
 * Determines whether the commits in from..to are linear, i.e. contain
 * no merge commits. This function *expects* `from` to be an ancestor of
 * `to`.
 */
static int is_linear_history(struct commit *from, struct commit *to)
{}

static int can_fast_forward(struct commit *onto, struct commit *upstream,
			    struct commit *restrict_revision,
			    struct commit *head, struct object_id *branch_base)
{}

static void fill_branch_base(struct rebase_options *options,
			    struct object_id *branch_base)
{}

static int parse_opt_am(const struct option *opt, const char *arg, int unset)
{}

/* -i followed by -m is still -i */
static int parse_opt_merge(const struct option *opt, const char *arg, int unset)
{}

/* -i followed by -r is still explicitly interactive, but -r alone is not */
static int parse_opt_interactive(const struct option *opt, const char *arg,
				 int unset)
{}

static enum empty_type parse_empty_value(const char *value)
{}

static int parse_opt_keep_empty(const struct option *opt, const char *arg,
				int unset)
{}

static int parse_opt_empty(const struct option *opt, const char *arg, int unset)
{}

static int parse_opt_rebase_merges(const struct option *opt, const char *arg, int unset)
{}

static void NORETURN error_on_missing_default_upstream(void)
{}

static int check_exec_cmd(const char *cmd)
{}

int cmd_rebase(int argc,
	       const char **argv,
	       const char *prefix,
	       struct repository *repo UNUSED)
{}