git/builtin/name-rev.c

#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "config.h"
#include "commit.h"
#include "tag.h"
#include "refs.h"
#include "object-name.h"
#include "pager.h"
#include "parse-options.h"
#include "prio-queue.h"
#include "hash-lookup.h"
#include "commit-slab.h"
#include "commit-graph.h"
#include "wildmatch.h"
#include "mem-pool.h"

/*
 * One day.  See the 'name a rev shortly after epoch' test in t6120 when
 * changing this value
 */
#define CUTOFF_DATE_SLOP

struct rev_name {};

define_commit_slab(commit_rev_name, struct rev_name);

static timestamp_t generation_cutoff =;
static timestamp_t cutoff =;
static struct commit_rev_name rev_names;

/* Disable the cutoff checks entirely */
static void disable_cutoff(void)
{}

/* Cutoff searching any commits older than this one */
static void set_commit_cutoff(struct commit *commit)
{}

/* adjust the commit date cutoff with a slop to allow for slightly incorrect
 * commit timestamps in case of clock skew.
 */
static void adjust_cutoff_timestamp_for_slop(void)
{}

/* Check if a commit is before the cutoff. Prioritize generation numbers
 * first, but use the commit timestamp if we lack generation data.
 */
static int commit_is_before_cutoff(struct commit *commit)
{}

/* How many generations are maximally preferred over _one_ merge traversal? */
#define MERGE_TRAVERSAL_WEIGHT

static int is_valid_rev_name(const struct rev_name *name)
{}

static struct rev_name *get_commit_rev_name(const struct commit *commit)
{}

static int effective_distance(int distance, int generation)
{}

static int is_better_name(struct rev_name *name,
			  timestamp_t taggerdate,
			  int generation,
			  int distance,
			  int from_tag)
{}

static struct rev_name *create_or_update_name(struct commit *commit,
					      timestamp_t taggerdate,
					      int generation, int distance,
					      int from_tag)
{}

static char *get_parent_name(const struct rev_name *name, int parent_number,
			     struct mem_pool *string_pool)
{}

static void name_rev(struct commit *start_commit,
		const char *tip_name, timestamp_t taggerdate,
		int from_tag, int deref, struct mem_pool *string_pool)
{}

static int subpath_matches(const char *path, const char *filter)
{}

struct name_ref_data {};

static struct tip_table {} tip_table;

static void add_to_tip_table(const struct object_id *oid, const char *refname,
			     int shorten_unambiguous, struct commit *commit,
			     timestamp_t taggerdate, int from_tag, int deref)
{}

static int tipcmp(const void *a_, const void *b_)
{}

static int cmp_by_tag_and_age(const void *a_, const void *b_)
{}

static int name_ref(const char *path, const char *referent UNUSED, const struct object_id *oid,
		    int flags UNUSED, void *cb_data)
{}

static void name_tips(struct mem_pool *string_pool)
{}

static const struct object_id *nth_tip_table_ent(size_t ix, const void *table_)
{}

static const char *get_exact_ref_match(const struct object *o)
{}

/* may return a constant string or use "buf" as scratch space */
static const char *get_rev_name(const struct object *o, struct strbuf *buf)
{}

static void show_name(const struct object *obj,
		      const char *caller_name,
		      int always, int allow_undefined, int name_only)
{}

static char const * const name_rev_usage[] =;

static void name_rev_line(char *p, struct name_ref_data *data)
{}

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