git/builtin/blame.c

/*
 * Blame
 *
 * Copyright (c) 2006, 2014 by its authors
 * See COPYING for licensing conditions
 */
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "color.h"
#include "builtin.h"
#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "commit.h"
#include "diff.h"
#include "revision.h"
#include "quote.h"
#include "string-list.h"
#include "mailmap.h"
#include "parse-options.h"
#include "prio-queue.h"
#include "utf8.h"
#include "userdiff.h"
#include "line-range.h"
#include "line-log.h"
#include "progress.h"
#include "object-name.h"
#include "object-store-ll.h"
#include "pager.h"
#include "blame.h"
#include "refs.h"
#include "setup.h"
#include "tag.h"
#include "write-or-die.h"

static char blame_usage[] =);
static char annotate_usage[] =);

static const char *blame_opt_usage[] =;

static const char *annotate_opt_usage[] =;

static int longest_file;
static int longest_author;
static int max_orig_digits;
static int max_digits;
static int max_score_digits;
static int show_root;
static int reverse;
static int blank_boundary;
static int incremental;
static int xdl_opts;
static int abbrev =;
static int no_whole_file_rename;
static int show_progress;
static char repeated_meta_color[COLOR_MAXLEN];
static int coloring_mode;
static struct string_list ignore_revs_file_list =;
static int mark_unblamable_lines;
static int mark_ignored_lines;

static struct date_mode blame_date_mode =;
static size_t blame_date_width;

static struct string_list mailmap =;

#ifndef DEBUG_BLAME
#define DEBUG_BLAME
#endif

static unsigned blame_move_score;
static unsigned blame_copy_score;

/* Remember to update object flag allocation in object.h */
#define METAINFO_SHOWN
#define MORE_THAN_ONE_PATH

struct progress_info {};

static const char *nth_line_cb(void *data, long lno)
{}

/*
 * Information on commits, used for output.
 */
struct commit_info {};

#define COMMIT_INFO_INIT

/*
 * Parse author/committer line in the commit object buffer
 */
static void get_ac_line(const char *inbuf, const char *what,
	struct strbuf *name, struct strbuf *mail,
	timestamp_t *time, struct strbuf *tz)
{}

static void commit_info_destroy(struct commit_info *ci)
{}

static void get_commit_info(struct commit *commit,
			    struct commit_info *ret,
			    int detailed)
{}

/*
 * Write out any suspect information which depends on the path. This must be
 * handled separately from emit_one_suspect_detail(), because a given commit
 * may have changes in multiple paths. So this needs to appear each time
 * we mention a new group.
 *
 * To allow LF and other nonportable characters in pathnames,
 * they are c-style quoted as needed.
 */
static void write_filename_info(struct blame_origin *suspect)
{}

/*
 * Porcelain/Incremental format wants to show a lot of details per
 * commit.  Instead of repeating this every line, emit it only once,
 * the first time each commit appears in the output (unless the
 * user has specifically asked for us to repeat).
 */
static int emit_one_suspect_detail(struct blame_origin *suspect, int repeat)
{}

/*
 * The blame_entry is found to be guilty for the range.
 * Show it in incremental output.
 */
static void found_guilty_entry(struct blame_entry *ent, void *data)
{}

static const char *format_time(timestamp_t time, const char *tz_str,
			       int show_raw_time)
{}

#define OUTPUT_ANNOTATE_COMPAT
#define OUTPUT_LONG_OBJECT_NAME
#define OUTPUT_RAW_TIMESTAMP
#define OUTPUT_PORCELAIN
#define OUTPUT_SHOW_NAME
#define OUTPUT_SHOW_NUMBER
#define OUTPUT_SHOW_SCORE
#define OUTPUT_NO_AUTHOR
#define OUTPUT_SHOW_EMAIL
#define OUTPUT_LINE_PORCELAIN
#define OUTPUT_COLOR_LINE
#define OUTPUT_SHOW_AGE_WITH_COLOR

static void emit_porcelain_details(struct blame_origin *suspect, int repeat)
{}

static void emit_porcelain(struct blame_scoreboard *sb, struct blame_entry *ent,
			   int opt)
{}

static struct color_field {} *colorfield;
static int colorfield_nr, colorfield_alloc;

static void parse_color_fields(const char *s)
{}

static void setup_default_color_by_age(void)
{}

static void determine_line_heat(struct commit_info *ci, const char **dest_color)
{}

static void emit_other(struct blame_scoreboard *sb, struct blame_entry *ent, int opt)
{}

static void output(struct blame_scoreboard *sb, int option)
{}

/*
 * Add phony grafts for use with -S; this is primarily to
 * support git's cvsserver that wants to give a linear history
 * to its clients.
 */
static int read_ancestry(const char *graft_file)
{}

static int update_auto_abbrev(int auto_abbrev, struct blame_origin *suspect)
{}

/*
 * How many columns do we need to show line numbers, authors,
 * and filenames?
 */
static void find_alignment(struct blame_scoreboard *sb, int *option)
{}

static void sanity_check_on_fail(struct blame_scoreboard *sb, int baa)
{}

static unsigned parse_score(const char *arg)
{}

static char *add_prefix(const char *prefix, const char *path)
{}

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

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

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

static int is_a_rev(const char *name)
{}

static int peel_to_commit_oid(struct object_id *oid_ret, void *cbdata)
{}

static void build_ignorelist(struct blame_scoreboard *sb,
			     struct string_list *ignore_revs_file_list,
			     struct string_list *ignore_rev_list)
{}

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