git/commit.c

#define USE_THE_REPOSITORY_VARIABLE

#include "git-compat-util.h"
#include "tag.h"
#include "commit.h"
#include "commit-graph.h"
#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "repository.h"
#include "object-name.h"
#include "object-store-ll.h"
#include "utf8.h"
#include "diff.h"
#include "revision.h"
#include "notes.h"
#include "alloc.h"
#include "gpg-interface.h"
#include "mergesort.h"
#include "commit-slab.h"
#include "prio-queue.h"
#include "hash-lookup.h"
#include "wt-status.h"
#include "advice.h"
#include "refs.h"
#include "commit-reach.h"
#include "setup.h"
#include "shallow.h"
#include "tree.h"
#include "hook.h"
#include "parse.h"
#include "object-file-convert.h"

static struct commit_extra_header *read_commit_extra_header_lines(const char *buf, size_t len, const char **);

int save_commit_buffer =;
int no_graft_file_deprecated_advice;

const char *commit_type =;

struct commit *lookup_commit_reference_gently(struct repository *r,
		const struct object_id *oid, int quiet)
{}

struct commit *lookup_commit_reference(struct repository *r, const struct object_id *oid)
{}

struct commit *lookup_commit_or_die(const struct object_id *oid, const char *ref_name)
{}

struct commit *lookup_commit_object(struct repository *r,
				    const struct object_id *oid)
{}

struct commit *lookup_commit(struct repository *r, const struct object_id *oid)
{}

struct commit *lookup_commit_reference_by_name(const char *name)
{}

struct commit *lookup_commit_reference_by_name_gently(const char *name,
						      int quiet)
{}

static timestamp_t parse_commit_date(const char *buf, const char *tail)
{}

static const struct object_id *commit_graft_oid_access(size_t index, const void *table)
{}

int commit_graft_pos(struct repository *r, const struct object_id *oid)
{}

void unparse_commit(struct repository *r, const struct object_id *oid)
{}

int register_commit_graft(struct repository *r, struct commit_graft *graft,
			  int ignore_dups)
{}

struct commit_graft *read_graft_line(struct strbuf *line)
{}

static int read_graft_file(struct repository *r, const char *graft_file)
{}

void prepare_commit_graft(struct repository *r)
{}

struct commit_graft *lookup_commit_graft(struct repository *r, const struct object_id *oid)
{}

int for_each_commit_graft(each_commit_graft_fn fn, void *cb_data)
{}

struct commit_buffer {};
define_commit_slab(buffer_slab, struct commit_buffer);

struct buffer_slab *allocate_commit_buffer_slab(void)
{}

void free_commit_buffer_slab(struct buffer_slab *bs)
{}

void set_commit_buffer(struct repository *r, struct commit *commit, void *buffer, unsigned long size)
{}

const void *get_cached_commit_buffer(struct repository *r, const struct commit *commit, unsigned long *sizep)
{}

const void *repo_get_commit_buffer(struct repository *r,
				   const struct commit *commit,
				   unsigned long *sizep)
{}

void repo_unuse_commit_buffer(struct repository *r,
			      const struct commit *commit,
			      const void *buffer)
{}

void free_commit_buffer(struct parsed_object_pool *pool, struct commit *commit)
{}

static inline void set_commit_tree(struct commit *c, struct tree *t)
{}

struct tree *repo_get_commit_tree(struct repository *r,
				  const struct commit *commit)
{}

struct object_id *get_commit_tree_oid(const struct commit *commit)
{}

void release_commit_memory(struct parsed_object_pool *pool, struct commit *c)
{}

const void *detach_commit_buffer(struct commit *commit, unsigned long *sizep)
{}

int parse_commit_buffer(struct repository *r, struct commit *item, const void *buffer, unsigned long size, int check_graph)
{}

int repo_parse_commit_internal(struct repository *r,
			       struct commit *item,
			       int quiet_on_missing,
			       int use_commit_graph)
{}

int repo_parse_commit_gently(struct repository *r,
			     struct commit *item, int quiet_on_missing)
{}

void parse_commit_or_die(struct commit *item)
{}

int find_commit_subject(const char *commit_buffer, const char **subject)
{}

size_t commit_subject_length(const char *body)
{}

struct commit_list *commit_list_insert(struct commit *item, struct commit_list **list_p)
{}

int commit_list_contains(struct commit *item, struct commit_list *list)
{}

unsigned commit_list_count(const struct commit_list *l)
{}

struct commit_list *copy_commit_list(const struct commit_list *list)
{}

struct commit_list *reverse_commit_list(struct commit_list *list)
{}

void free_commit_list(struct commit_list *list)
{}

struct commit_list * commit_list_insert_by_date(struct commit *item, struct commit_list **list)
{}

static int commit_list_compare_by_date(const struct commit_list *a,
				       const struct commit_list *b)
{}

DEFINE_LIST_SORT();

void commit_list_sort_by_date(struct commit_list **list)
{}

struct commit *pop_most_recent_commit(struct commit_list **list,
				      unsigned int mark)
{}

static void clear_commit_marks_1(struct commit_list **plist,
				 struct commit *commit, unsigned int mark)
{}

void clear_commit_marks_many(int nr, struct commit **commit, unsigned int mark)
{}

void clear_commit_marks(struct commit *commit, unsigned int mark)
{}

struct commit *pop_commit(struct commit_list **stack)
{}

/*
 * Topological sort support
 */

/* count number of children that have not been emitted */
define_commit_slab(indegree_slab, int);

define_commit_slab(author_date_slab, timestamp_t);

void record_author_date(struct author_date_slab *author_date,
			struct commit *commit)
{}

int compare_commits_by_author_date(const void *a_, const void *b_,
				   void *cb_data)
{}

int compare_commits_by_gen_then_commit_date(const void *a_, const void *b_,
					    void *unused UNUSED)
{}

int compare_commits_by_commit_date(const void *a_, const void *b_,
				   void *unused UNUSED)
{}

/*
 * Performs an in-place topological sort on the list supplied.
 */
void sort_in_topological_order(struct commit_list **list, enum rev_sort_order sort_order)
{}

struct rev_collect {};

static void add_one_commit(struct object_id *oid, struct rev_collect *revs)
{}

static int collect_one_reflog_ent(struct object_id *ooid, struct object_id *noid,
				  const char *ident UNUSED,
				  timestamp_t timestamp UNUSED, int tz UNUSED,
				  const char *message UNUSED, void *cbdata)
{}

struct commit *get_fork_point(const char *refname, struct commit *commit)
{}

/*
 * Indexed by hash algorithm identifier.
 */
static const char *gpg_sig_headers[] =;

int add_header_signature(struct strbuf *buf, struct strbuf *sig, const struct git_hash_algo *algo)
{}

static int sign_commit_to_strbuf(struct strbuf *sig, struct strbuf *buf, const char *keyid)
{}

int parse_signed_commit(const struct commit *commit,
			struct strbuf *payload, struct strbuf *signature,
			const struct git_hash_algo *algop)
{}

int parse_buffer_signed_by_header(const char *buffer,
				  unsigned long size,
				  struct strbuf *payload,
				  struct strbuf *signature,
				  const struct git_hash_algo *algop)
{}

int remove_signature(struct strbuf *buf)
{}

static void handle_signed_tag(const struct commit *parent, struct commit_extra_header ***tail)
{}

int check_commit_signature(const struct commit *commit, struct signature_check *sigc)
{}

void verify_merge_signature(struct commit *commit, int verbosity,
			    int check_trust)
{}

void append_merge_tag_headers(const struct commit_list *parents,
			      struct commit_extra_header ***tail)
{}

static int convert_commit_extra_headers(const struct commit_extra_header *orig,
					struct commit_extra_header **result)
{}

static void add_extra_header(struct strbuf *buffer,
			     const struct commit_extra_header *extra)
{}

struct commit_extra_header *read_commit_extra_headers(struct commit *commit,
						      const char **exclude)
{}

int for_each_mergetag(each_mergetag_fn fn, struct commit *commit, void *data)
{}

static inline int standard_header_field(const char *field, size_t len)
{}

static int excluded_header_field(const char *field, size_t len, const char **exclude)
{}

static struct commit_extra_header *read_commit_extra_header_lines(
	const char *buffer, size_t size,
	const char **exclude)
{}

void free_commit_extra_headers(struct commit_extra_header *extra)
{}

int commit_tree(const char *msg, size_t msg_len, const struct object_id *tree,
		const struct commit_list *parents, struct object_id *ret,
		const char *author, const char *sign_commit)
{}

static int find_invalid_utf8(const char *buf, int len)
{}

/*
 * This verifies that the buffer is in proper utf8 format.
 *
 * If it isn't, it assumes any non-utf8 characters are Latin1,
 * and does the conversion.
 */
static int verify_utf8(struct strbuf *buf)
{}

static const char commit_utf8_warn[] =);

static void write_commit_tree(struct strbuf *buffer, const char *msg, size_t msg_len,
			      const struct object_id *tree,
			      const struct object_id *parents, size_t parents_len,
			      const char *author, const char *committer,
			      const struct commit_extra_header *extra)
{}

int commit_tree_extended(const char *msg, size_t msg_len,
			 const struct object_id *tree,
			 const struct commit_list *parents, struct object_id *ret,
			 const char *author, const char *committer,
			 const char *sign_commit,
			 const struct commit_extra_header *extra)
{}

define_commit_slab(merge_desc_slab, struct merge_remote_desc *);
static struct merge_desc_slab merge_desc_slab =;

struct merge_remote_desc *merge_remote_util(const struct commit *commit)
{}

void set_merge_remote_desc(struct commit *commit,
			   const char *name, struct object *obj)
{}

struct commit *get_merge_parent(const char *name)
{}

/*
 * Append a commit to the end of the commit_list.
 *
 * next starts by pointing to the variable that holds the head of an
 * empty commit_list, and is updated to point to the "next" field of
 * the last item on the list as new commits are appended.
 *
 * Usage example:
 *
 *     struct commit_list *list;
 *     struct commit_list **next = &list;
 *
 *     next = commit_list_append(c1, next);
 *     next = commit_list_append(c2, next);
 *     assert(commit_list_count(list) == 2);
 *     return list;
 */
struct commit_list **commit_list_append(struct commit *commit,
					struct commit_list **next)
{}

const char *find_commit_header(const char *msg, const char *key, size_t *out_len)
{}

/*
 * Inspect the given string and determine the true "end" of the log message, in
 * order to find where to put a new Signed-off-by trailer.  Ignored are
 * trailing comment lines and blank lines.  To support "git commit -s
 * --amend" on an existing commit, we also ignore "Conflicts:".  To
 * support "git commit -v", we truncate at cut lines.
 *
 * Returns the number of bytes from the tail to ignore, to be fed as
 * the second parameter to append_signoff().
 */
size_t ignored_log_message_bytes(const char *buf, size_t len)
{}

int run_commit_hook(int editor_is_used, const char *index_file,
		    int *invoked_hook, const char *name, ...)
{}