#define USE_THE_REPOSITORY_VARIABLE
#include "git-compat-util.h"
#include "config.h"
#include "csum-file.h"
#include "gettext.h"
#include "hex.h"
#include "lockfile.h"
#include "packfile.h"
#include "commit.h"
#include "object.h"
#include "refs.h"
#include "hash-lookup.h"
#include "commit-graph.h"
#include "object-file.h"
#include "object-store-ll.h"
#include "oid-array.h"
#include "path.h"
#include "alloc.h"
#include "hashmap.h"
#include "replace-object.h"
#include "progress.h"
#include "bloom.h"
#include "commit-slab.h"
#include "shallow.h"
#include "json-writer.h"
#include "trace2.h"
#include "tree.h"
#include "chunk-format.h"
void git_test_write_commit_graph_or_die(void)
{ … }
#define GRAPH_SIGNATURE …
#define GRAPH_CHUNKID_OIDFANOUT …
#define GRAPH_CHUNKID_OIDLOOKUP …
#define GRAPH_CHUNKID_DATA …
#define GRAPH_CHUNKID_GENERATION_DATA …
#define GRAPH_CHUNKID_GENERATION_DATA_OVERFLOW …
#define GRAPH_CHUNKID_EXTRAEDGES …
#define GRAPH_CHUNKID_BLOOMINDEXES …
#define GRAPH_CHUNKID_BLOOMDATA …
#define GRAPH_CHUNKID_BASE …
#define GRAPH_DATA_WIDTH …
#define GRAPH_VERSION_1 …
#define GRAPH_VERSION …
#define GRAPH_EXTRA_EDGES_NEEDED …
#define GRAPH_EDGE_LAST_MASK …
#define GRAPH_PARENT_NONE …
#define GRAPH_LAST_EDGE …
#define GRAPH_HEADER_SIZE …
#define GRAPH_FANOUT_SIZE …
#define GRAPH_MIN_SIZE …
#define CORRECTED_COMMIT_DATE_OFFSET_OVERFLOW …
#define REACHABLE …
define_commit_slab(topo_level_slab, uint32_t);
define_commit_slab(commit_pos, int);
static struct commit_pos commit_pos = …;
static void set_commit_pos(struct repository *r, const struct object_id *oid)
{ … }
static int commit_pos_cmp(const void *va, const void *vb)
{ … }
define_commit_slab(commit_graph_data_slab, struct commit_graph_data);
static struct commit_graph_data_slab commit_graph_data_slab = …;
static int get_configured_generation_version(struct repository *r)
{ … }
uint32_t commit_graph_position(const struct commit *c)
{ … }
timestamp_t commit_graph_generation(const struct commit *c)
{ … }
static timestamp_t commit_graph_generation_from_graph(const struct commit *c)
{ … }
static struct commit_graph_data *commit_graph_data_at(const struct commit *c)
{ … }
static int commit_gen_cmp(const void *va, const void *vb)
{ … }
char *get_commit_graph_filename(struct object_directory *obj_dir)
{ … }
static char *get_split_graph_filename(struct object_directory *odb,
const char *oid_hex)
{ … }
char *get_commit_graph_chain_filename(struct object_directory *odb)
{ … }
static struct commit_graph *alloc_commit_graph(void)
{ … }
static int commit_graph_compatible(struct repository *r)
{ … }
int open_commit_graph(const char *graph_file, int *fd, struct stat *st)
{ … }
struct commit_graph *load_commit_graph_one_fd_st(struct repository *r,
int fd, struct stat *st,
struct object_directory *odb)
{ … }
static int graph_read_oid_fanout(const unsigned char *chunk_start,
size_t chunk_size, void *data)
{ … }
static int graph_read_oid_lookup(const unsigned char *chunk_start,
size_t chunk_size, void *data)
{ … }
static int graph_read_commit_data(const unsigned char *chunk_start,
size_t chunk_size, void *data)
{ … }
static int graph_read_generation_data(const unsigned char *chunk_start,
size_t chunk_size, void *data)
{ … }
static int graph_read_bloom_index(const unsigned char *chunk_start,
size_t chunk_size, void *data)
{ … }
static int graph_read_bloom_data(const unsigned char *chunk_start,
size_t chunk_size, void *data)
{ … }
struct commit_graph *parse_commit_graph(struct repo_settings *s,
void *graph_map, size_t graph_size)
{ … }
static struct commit_graph *load_commit_graph_one(struct repository *r,
const char *graph_file,
struct object_directory *odb)
{ … }
static struct commit_graph *load_commit_graph_v1(struct repository *r,
struct object_directory *odb)
{ … }
static int validate_mixed_generation_chain(struct commit_graph *g)
{ … }
static void validate_mixed_bloom_settings(struct commit_graph *g)
{ … }
static int add_graph_to_chain(struct commit_graph *g,
struct commit_graph *chain,
struct object_id *oids,
int n)
{ … }
int open_commit_graph_chain(const char *chain_file,
int *fd, struct stat *st)
{ … }
struct commit_graph *load_commit_graph_chain_fd_st(struct repository *r,
int fd, struct stat *st,
int *incomplete_chain)
{ … }
static struct commit_graph *load_commit_graph_chain(struct repository *r,
struct object_directory *odb)
{ … }
struct commit_graph *read_commit_graph_one(struct repository *r,
struct object_directory *odb)
{ … }
static void prepare_commit_graph_one(struct repository *r,
struct object_directory *odb)
{ … }
static int prepare_commit_graph(struct repository *r)
{ … }
int generation_numbers_enabled(struct repository *r)
{ … }
int corrected_commit_dates_enabled(struct repository *r)
{ … }
struct bloom_filter_settings *get_bloom_filter_settings(struct repository *r)
{ … }
void close_commit_graph(struct raw_object_store *o)
{ … }
static int bsearch_graph(struct commit_graph *g, const struct object_id *oid, uint32_t *pos)
{ … }
static void load_oid_from_graph(struct commit_graph *g,
uint32_t pos,
struct object_id *oid)
{ … }
static struct commit_list **insert_parent_or_die(struct repository *r,
struct commit_graph *g,
uint32_t pos,
struct commit_list **pptr)
{ … }
static void fill_commit_graph_info(struct commit *item, struct commit_graph *g, uint32_t pos)
{ … }
static inline void set_commit_tree(struct commit *c, struct tree *t)
{ … }
static int fill_commit_in_graph(struct repository *r,
struct commit *item,
struct commit_graph *g, uint32_t pos)
{ … }
static int search_commit_pos_in_graph(const struct object_id *id, struct commit_graph *g, uint32_t *pos)
{ … }
static int find_commit_pos_in_graph(struct commit *item, struct commit_graph *g, uint32_t *pos)
{ … }
int repo_find_commit_pos_in_graph(struct repository *r, struct commit *c,
uint32_t *pos)
{ … }
struct commit *lookup_commit_in_graph(struct repository *repo, const struct object_id *id)
{ … }
static int parse_commit_in_graph_one(struct repository *r,
struct commit_graph *g,
struct commit *item)
{ … }
int parse_commit_in_graph(struct repository *r, struct commit *item)
{ … }
void load_commit_graph_info(struct repository *r, struct commit *item)
{ … }
static struct tree *load_tree_for_commit(struct repository *r,
struct commit_graph *g,
struct commit *c)
{ … }
static struct tree *get_commit_tree_in_graph_one(struct repository *r,
struct commit_graph *g,
const struct commit *c)
{ … }
struct tree *get_commit_tree_in_graph(struct repository *r, const struct commit *c)
{ … }
struct packed_commit_list { … };
struct write_commit_graph_context { … };
static int write_graph_chunk_fanout(struct hashfile *f,
void *data)
{ … }
static int write_graph_chunk_oids(struct hashfile *f,
void *data)
{ … }
static const struct object_id *commit_to_oid(size_t index, const void *table)
{ … }
static int write_graph_chunk_data(struct hashfile *f,
void *data)
{ … }
static int write_graph_chunk_generation_data(struct hashfile *f,
void *data)
{ … }
static int write_graph_chunk_generation_data_overflow(struct hashfile *f,
void *data)
{ … }
static int write_graph_chunk_extra_edges(struct hashfile *f,
void *data)
{ … }
static int write_graph_chunk_bloom_indexes(struct hashfile *f,
void *data)
{ … }
static void trace2_bloom_filter_settings(struct write_commit_graph_context *ctx)
{ … }
static int write_graph_chunk_bloom_data(struct hashfile *f,
void *data)
{ … }
static int add_packed_commits(const struct object_id *oid,
struct packed_git *pack,
uint32_t pos,
void *data)
{ … }
static void add_missing_parents(struct write_commit_graph_context *ctx, struct commit *commit)
{ … }
static void close_reachable(struct write_commit_graph_context *ctx)
{ … }
struct compute_generation_info { … };
static timestamp_t compute_generation_from_max(struct commit *c,
timestamp_t max_gen,
int generation_version)
{ … }
static void compute_reachable_generation_numbers(
struct compute_generation_info *info,
int generation_version)
{ … }
static timestamp_t get_topo_level(struct commit *c, void *data)
{ … }
static void set_topo_level(struct commit *c, timestamp_t t, void *data)
{ … }
static void compute_topological_levels(struct write_commit_graph_context *ctx)
{ … }
static timestamp_t get_generation_from_graph_data(struct commit *c,
void *data UNUSED)
{ … }
static void set_generation_v2(struct commit *c, timestamp_t t,
void *data UNUSED)
{ … }
static void compute_generation_numbers(struct write_commit_graph_context *ctx)
{ … }
static void set_generation_in_graph_data(struct commit *c, timestamp_t t,
void *data UNUSED)
{ … }
void ensure_generations_valid(struct repository *r,
struct commit **commits, size_t nr)
{ … }
static void trace2_bloom_filter_write_statistics(struct write_commit_graph_context *ctx)
{ … }
static void compute_bloom_filters(struct write_commit_graph_context *ctx)
{ … }
struct refs_cb_data { … };
static int add_ref_to_set(const char *refname UNUSED,
const char *referent UNUSED,
const struct object_id *oid,
int flags UNUSED, void *cb_data)
{ … }
int write_commit_graph_reachable(struct object_directory *odb,
enum commit_graph_write_flags flags,
const struct commit_graph_opts *opts)
{ … }
static int fill_oids_from_packs(struct write_commit_graph_context *ctx,
const struct string_list *pack_indexes)
{ … }
static int fill_oids_from_commits(struct write_commit_graph_context *ctx,
struct oidset *commits)
{ … }
static void fill_oids_from_all_packs(struct write_commit_graph_context *ctx)
{ … }
static void copy_oids_to_commits(struct write_commit_graph_context *ctx)
{ … }
static int write_graph_chunk_base_1(struct hashfile *f,
struct commit_graph *g)
{ … }
static int write_graph_chunk_base(struct hashfile *f,
void *data)
{ … }
static int write_commit_graph_file(struct write_commit_graph_context *ctx)
{ … }
static void split_graph_merge_strategy(struct write_commit_graph_context *ctx)
{ … }
static void merge_commit_graph(struct write_commit_graph_context *ctx,
struct commit_graph *g)
{ … }
static int commit_compare(const void *_a, const void *_b)
{ … }
static void sort_and_scan_merged_commits(struct write_commit_graph_context *ctx)
{ … }
static void merge_commit_graphs(struct write_commit_graph_context *ctx)
{ … }
static void mark_commit_graphs(struct write_commit_graph_context *ctx)
{ … }
static void expire_commit_graphs(struct write_commit_graph_context *ctx)
{ … }
int write_commit_graph(struct object_directory *odb,
const struct string_list *const pack_indexes,
struct oidset *commits,
enum commit_graph_write_flags flags,
const struct commit_graph_opts *opts)
{ … }
#define VERIFY_COMMIT_GRAPH_ERROR_HASH …
static int verify_commit_graph_error;
__attribute__((format (printf, 1, 2)))
static void graph_report(const char *fmt, ...)
{ … }
static int commit_graph_checksum_valid(struct commit_graph *g)
{ … }
static int verify_one_commit_graph(struct repository *r,
struct commit_graph *g,
struct progress *progress,
uint64_t *seen)
{ … }
int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags)
{ … }
void free_commit_graph(struct commit_graph *g)
{ … }
void disable_commit_graph(struct repository *r)
{ … }