git/ident.c

/*
 * ident.c
 *
 * create git identifier lines of the form "name <email> date"
 *
 * Copyright (C) 2005 Linus Torvalds
 */
#include "git-compat-util.h"
#include "ident.h"
#include "config.h"
#include "date.h"
#include "gettext.h"
#include "mailmap.h"
#include "strbuf.h"

static struct strbuf git_default_name =;
static struct strbuf git_default_email =;
static struct strbuf git_default_date =;
static struct strbuf git_author_name =;
static struct strbuf git_author_email =;
static struct strbuf git_committer_name =;
static struct strbuf git_committer_email =;
static int default_email_is_bogus;
static int default_name_is_bogus;

static int ident_use_config_only;

#define IDENT_NAME_GIVEN
#define IDENT_MAIL_GIVEN
#define IDENT_ALL_GIVEN
static int committer_ident_explicitly_given;
static int author_ident_explicitly_given;
static int ident_config_given;

#ifdef NO_GECOS_IN_PWENT
#define get_gecos
#else
#define get_gecos(struct_passwd)
#endif

static struct passwd *xgetpwuid_self(int *is_bogus)
{}

static void copy_gecos(const struct passwd *w, struct strbuf *name)
{}

static int add_mailname_host(struct strbuf *buf)
{}

static int canonical_name(const char *host, struct strbuf *out)
{}

static void add_domainname(struct strbuf *out, int *is_bogus)
{}

static void copy_email(const struct passwd *pw, struct strbuf *email,
		       int *is_bogus)
{}

const char *ident_default_name(void)
{}

const char *ident_default_email(void)
{}

static const char *ident_default_date(void)
{}

void reset_ident_date(void)
{}

static int crud(unsigned char c)
{}

static int has_non_crud(const char *str)
{}

/*
 * Copy over a string to the destination, but avoid special
 * characters ('\n', '<' and '>') and remove crud at the end
 */
static void strbuf_addstr_without_crud(struct strbuf *sb, const char *src)
{}

/*
 * Reverse of fmt_ident(); given an ident line, split the fields
 * to allow the caller to parse it.
 * Signal a success by returning 0, but date/tz fields of the result
 * can still be NULL if the input line only has the name/email part
 * (e.g. reading from a reflog entry).
 */
int split_ident_line(struct ident_split *split, const char *line, int len)
{}

/*
 * Returns the difference between the new and old length of the ident line.
 */
static ssize_t rewrite_ident_line(const char *person, size_t len,
				   struct strbuf *buf,
				   struct string_list *mailmap)
{}

void apply_mailmap_to_header(struct strbuf *buf, const char **header,
			       struct string_list *mailmap)
{}

static void ident_env_hint(enum want_ident whose_ident)
{}

const char *fmt_ident(const char *name, const char *email,
		      enum want_ident whose_ident, const char *date_str, int flag)
{}

const char *fmt_name(enum want_ident whose_ident)
{}

const char *git_author_info(int flag)
{}

const char *git_committer_info(int flag)
{}

static int ident_is_sufficient(int user_ident_explicitly_given)
{}

int committer_ident_sufficiently_given(void)
{}

int author_ident_sufficiently_given(void)
{}

static int set_ident(const char *var, const char *value)
{}

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

static void set_env_if(const char *key, const char *value, int *given, int bit)
{}

void prepare_fallback_ident(const char *name, const char *email)
{}

static int buf_cmp(const char *a_begin, const char *a_end,
		   const char *b_begin, const char *b_end)
{}

int ident_cmp(const struct ident_split *a,
	      const struct ident_split *b)
{}