git/builtin/merge-tree.c

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "tree-walk.h"
#include "xdiff-interface.h"
#include "help.h"
#include "gettext.h"
#include "hex.h"
#include "commit.h"
#include "commit-reach.h"
#include "merge-ort.h"
#include "object-name.h"
#include "object-store-ll.h"
#include "parse-options.h"
#include "blob.h"
#include "merge-blobs.h"
#include "quote.h"
#include "tree.h"
#include "config.h"
#include "strvec.h"

static int line_termination =;

struct merge_list {};

static struct merge_list *merge_result, **merge_result_end =;

static void add_merge_entry(struct merge_list *entry)
{}

static void trivial_merge_trees(struct tree_desc t[3], const char *base);

static const char *explanation(struct merge_list *entry)
{}

static void *result(struct merge_list *entry, unsigned long *size)
{}

static void *origin(struct merge_list *entry, unsigned long *size)
{}

static int show_outf(void *priv UNUSED, mmbuffer_t *mb, int nbuf)
{}

static void show_diff(struct merge_list *entry)
{}

static void show_result_list(struct merge_list *entry)
{}

static void show_result(void)
{}

/* An empty entry never compares same, not even to another empty entry */
static int same_entry(struct name_entry *a, struct name_entry *b)
{}

static int both_empty(struct name_entry *a, struct name_entry *b)
{}

static struct merge_list *create_entry(unsigned stage, unsigned mode, const struct object_id *oid, const char *path)
{}

static char *traverse_path(const struct traverse_info *info, const struct name_entry *n)
{}

static void resolve(const struct traverse_info *info, struct name_entry *ours, struct name_entry *result)
{}

static void unresolved_directory(const struct traverse_info *info,
				 struct name_entry n[3])
{}


static struct merge_list *link_entry(unsigned stage, const struct traverse_info *info, struct name_entry *n, struct merge_list *entry)
{}

static void unresolved(const struct traverse_info *info, struct name_entry n[3])
{}

/*
 * Merge two trees together (t[1] and t[2]), using a common base (t[0])
 * as the origin.
 *
 * This walks the (sorted) trees in lock-step, checking every possible
 * name. Note that directories automatically sort differently from other
 * files (see "base_name_compare"), so you'll never see file/directory
 * conflicts, because they won't ever compare the same.
 *
 * IOW, if a directory changes to a filename, it will automatically be
 * seen as the directory going away, and the filename being created.
 *
 * Think of this as a three-way diff.
 *
 * The output will be either:
 *  - successful merge
 *	 "0 mode sha1 filename"
 *    NOTE NOTE NOTE! FIXME! We really really need to walk the index
 *    in parallel with this too!
 *
 *  - conflict:
 *	"1 mode sha1 filename"
 *	"2 mode sha1 filename"
 *	"3 mode sha1 filename"
 *    where not all of the 1/2/3 lines may exist, of course.
 *
 * The successful merge rules are the same as for the three-way merge
 * in git-read-tree.
 */
static int threeway_callback(int n UNUSED, unsigned long mask,
			     unsigned long dirmask UNUSED,
			     struct name_entry *entry, struct traverse_info *info)
{}

static void trivial_merge_trees(struct tree_desc t[3], const char *base)
{}

static void *get_tree_descriptor(struct repository *r,
				 struct tree_desc *desc,
				 const char *rev)
{}

static int trivial_merge(const char *base,
			 const char *branch1,
			 const char *branch2)
{}

enum mode {};

struct merge_tree_options {};

static int real_merge(struct merge_tree_options *o,
		      const char *merge_base,
		      const char *branch1, const char *branch2,
		      const char *prefix)
{}

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