#define USE_THE_REPOSITORY_VARIABLE
#include "git-compat-util.h"
#include "config.h"
#include "environment.h"
#include "gettext.h"
#include "string-list.h"
#include "run-command.h"
#include "commit.h"
#include "trailer.h"
#include "list.h"
struct trailer_info { … };
struct conf_info { … };
static struct conf_info default_conf_info;
struct trailer_item { … };
struct arg_item { … };
static LIST_HEAD(conf_head);
static const char *separators = …;
static int configured;
#define TRAILER_ARG_STRING …
static const char *git_generated_prefixes[] = …;
#define list_for_each_dir(pos, head, is_reverse) …
static int after_or_end(enum trailer_where where)
{ … }
static size_t token_len_without_separator(const char *token, size_t len)
{ … }
static int same_token(struct trailer_item *a, struct arg_item *b)
{ … }
static int same_value(struct trailer_item *a, struct arg_item *b)
{ … }
static int same_trailer(struct trailer_item *a, struct arg_item *b)
{ … }
static inline int is_blank_line(const char *str)
{ … }
static inline void strbuf_replace(struct strbuf *sb, const char *a, const char *b)
{ … }
static void free_trailer_item(struct trailer_item *item)
{ … }
static void free_arg_item(struct arg_item *item)
{ … }
static char last_non_space_char(const char *s)
{ … }
static struct trailer_item *trailer_from_arg(struct arg_item *arg_tok)
{ … }
static void add_arg_to_input_list(struct trailer_item *on_tok,
struct arg_item *arg_tok)
{ … }
static int check_if_different(struct trailer_item *in_tok,
struct arg_item *arg_tok,
int check_all,
struct list_head *head)
{ … }
static char *apply_command(struct conf_info *conf, const char *arg)
{ … }
static void apply_item_command(struct trailer_item *in_tok, struct arg_item *arg_tok)
{ … }
static void apply_arg_if_exists(struct trailer_item *in_tok,
struct arg_item *arg_tok,
struct trailer_item *on_tok,
struct list_head *head)
{ … }
static void apply_arg_if_missing(struct list_head *head,
struct arg_item *arg_tok)
{ … }
static int find_same_and_apply_arg(struct list_head *head,
struct arg_item *arg_tok)
{ … }
void process_trailers_lists(struct list_head *head,
struct list_head *arg_head)
{ … }
int trailer_set_where(enum trailer_where *item, const char *value)
{ … }
int trailer_set_if_exists(enum trailer_if_exists *item, const char *value)
{ … }
int trailer_set_if_missing(enum trailer_if_missing *item, const char *value)
{ … }
static void duplicate_conf(struct conf_info *dst, const struct conf_info *src)
{ … }
static struct arg_item *get_conf_item(const char *name)
{ … }
enum trailer_info_type { … };
static struct { … } trailer_config_items[] = …;
static int git_trailer_default_config(const char *conf_key, const char *value,
const struct config_context *ctx UNUSED,
void *cb UNUSED)
{ … }
static int git_trailer_config(const char *conf_key, const char *value,
const struct config_context *ctx UNUSED,
void *cb UNUSED)
{ … }
void trailer_config_init(void)
{ … }
static const char *token_from_item(struct arg_item *item, char *tok)
{ … }
static int token_matches_item(const char *tok, struct arg_item *item, size_t tok_len)
{ … }
static ssize_t find_separator(const char *line, const char *separators)
{ … }
static void parse_trailer(struct strbuf *tok, struct strbuf *val,
const struct conf_info **conf, const char *trailer,
ssize_t separator_pos)
{ … }
static struct trailer_item *add_trailer_item(struct list_head *head, char *tok,
char *val)
{ … }
static void add_arg_item(struct list_head *arg_head, char *tok, char *val,
const struct conf_info *conf,
const struct new_trailer_item *new_trailer_item)
{ … }
void parse_trailers_from_config(struct list_head *config_head)
{ … }
void parse_trailers_from_command_line_args(struct list_head *arg_head,
struct list_head *new_trailer_head)
{ … }
static const char *next_line(const char *str)
{ … }
static ssize_t last_line(const char *buf, size_t len)
{ … }
static size_t find_end_of_log_message(const char *input, int no_divider)
{ … }
static size_t find_trailer_block_start(const char *buf, size_t len)
{ … }
static int ends_with_blank_line(const char *buf, size_t len)
{ … }
static void unfold_value(struct strbuf *val)
{ … }
static struct trailer_info *trailer_info_new(void)
{ … }
static struct trailer_info *trailer_info_get(const struct process_trailer_options *opts,
const char *str)
{ … }
struct trailer_info *parse_trailers(const struct process_trailer_options *opts,
const char *str,
struct list_head *trailer_objects)
{ … }
void free_trailers(struct list_head *trailers)
{ … }
size_t trailer_block_start(struct trailer_info *info)
{ … }
size_t trailer_block_end(struct trailer_info *info)
{ … }
int blank_line_before_trailer_block(struct trailer_info *info)
{ … }
void trailer_info_release(struct trailer_info *info)
{ … }
void format_trailers(const struct process_trailer_options *opts,
struct list_head *trailers,
struct strbuf *out)
{ … }
void format_trailers_from_commit(const struct process_trailer_options *opts,
const char *msg,
struct strbuf *out)
{ … }
void trailer_iterator_init(struct trailer_iterator *iter, const char *msg)
{ … }
int trailer_iterator_advance(struct trailer_iterator *iter)
{ … }
void trailer_iterator_release(struct trailer_iterator *iter)
{ … }
int amend_file_with_trailers(const char *path, const struct strvec *trailer_args)
{ … }