Uh oh!
There was an error while loading. Please reload this page.
forked from git/git
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommit-graph.h
More file actions
Latest commit
165 lines (138 loc) · 5.08 KB
/
Copy pathcommit-graph.h
File metadata and controls
165 lines (138 loc) · 5.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#ifndefCOMMIT_GRAPH_H
#defineCOMMIT_GRAPH_H
#include"git-compat-util.h"
#include"object-store.h"
#include"oidset.h"
#defineGIT_TEST_COMMIT_GRAPH "GIT_TEST_COMMIT_GRAPH"
#defineGIT_TEST_COMMIT_GRAPH_DIE_ON_PARSE "GIT_TEST_COMMIT_GRAPH_DIE_ON_PARSE"
#defineGIT_TEST_COMMIT_GRAPH_CHANGED_PATHS "GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS"
/*
* This method is only used to enhance coverage of the commit-graph
* feature in the test suite with the GIT_TEST_COMMIT_GRAPH and
* GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS environment variables. Do not
* call this method oustide of a builtin, and only if you know what
* you are doing!
*/
voidgit_test_write_commit_graph_or_die(void);
structcommit;
structbloom_filter_settings;
structrepository;
structraw_object_store;
structstring_list;
char*get_commit_graph_filename(structobject_directory*odb);
char*get_commit_graph_chain_filename(structobject_directory*odb);
intopen_commit_graph(constchar*graph_file, int*fd, structstat*st);
/*
* Given a commit struct, try to fill the commit struct info, including:
* 1. tree object
* 2. date
* 3. parents.
*
* Returns 1 if and only if the commit was found in the packed graph.
*
* See parse_commit_buffer() for the fallback after this call.
*/
intparse_commit_in_graph(structrepository*r, structcommit*item);
/*
* It is possible that we loaded commit contents from the commit buffer,
* but we also want to ensure the commit-graph content is correctly
* checked and filled. Fill the graph_pos and generation members of
* the given commit.
*/
voidload_commit_graph_info(structrepository*r, structcommit*item);
structtree*get_commit_tree_in_graph(structrepository*r,
conststructcommit*c);
structcommit_graph {
constunsigned char*data;
size_tdata_len;
unsigned charhash_len;
unsigned charnum_chunks;
uint32_tnum_commits;
structobject_idoid;
char*filename;
structobject_directory*odb;
uint32_tnum_commits_in_base;
unsigned intread_generation_data;
structcommit_graph*base_graph;
constuint32_t*chunk_oid_fanout;
constunsigned char*chunk_oid_lookup;
constunsigned char*chunk_commit_data;
constunsigned char*chunk_generation_data;
constunsigned char*chunk_generation_data_overflow;
constunsigned char*chunk_extra_edges;
constunsigned char*chunk_base_graphs;
constunsigned char*chunk_bloom_indexes;
constunsigned char*chunk_bloom_data;
structtopo_level_slab*topo_levels;
structbloom_filter_settings*bloom_filter_settings;
};
structcommit_graph*load_commit_graph_one_fd_st(structrepository*r,
intfd, structstat*st,
structobject_directory*odb);
structcommit_graph*read_commit_graph_one(structrepository*r,
structobject_directory*odb);
structcommit_graph*parse_commit_graph(structrepository*r,
void*graph_map, size_tgraph_size);
/*
* Return 1 if and only if the repository has a commit-graph
* file and generation numbers are computed in that file.
*/
intgeneration_numbers_enabled(structrepository*r);
/*
* Return 1 if and only if the repository has a commit-graph
* file and generation data chunk has been written for the file.
*/
intcorrected_commit_dates_enabled(structrepository*r);
structbloom_filter_settings*get_bloom_filter_settings(structrepository*r);
enumcommit_graph_write_flags {
COMMIT_GRAPH_WRITE_APPEND= (1 << 0),
COMMIT_GRAPH_WRITE_PROGRESS= (1 << 1),
COMMIT_GRAPH_WRITE_SPLIT= (1 << 2),
COMMIT_GRAPH_WRITE_BLOOM_FILTERS= (1 << 3),
COMMIT_GRAPH_NO_WRITE_BLOOM_FILTERS= (1 << 4),
};
enumcommit_graph_split_flags {
COMMIT_GRAPH_SPLIT_UNSPECIFIED=0,
COMMIT_GRAPH_SPLIT_MERGE_PROHIBITED=1,
COMMIT_GRAPH_SPLIT_REPLACE=2
};
structcommit_graph_opts {
intsize_multiple;
intmax_commits;
timestamp_texpire_time;
enumcommit_graph_split_flagssplit_flags;
intmax_new_filters;
};
/*
* The write_commit_graph* methods return zero on success
* and a negative value on failure. Note that if the repository
* is not compatible with the commit-graph feature, then the
* methods will return 0 without writing a commit-graph.
*/
intwrite_commit_graph_reachable(structobject_directory*odb,
enumcommit_graph_write_flagsflags,
conststructcommit_graph_opts*opts);
intwrite_commit_graph(structobject_directory*odb,
structstring_list*pack_indexes,
structoidset*commits,
enumcommit_graph_write_flagsflags,
conststructcommit_graph_opts*opts);
#defineCOMMIT_GRAPH_VERIFY_SHALLOW (1 << 0)
intverify_commit_graph(structrepository*r, structcommit_graph*g, intflags);
voidclose_commit_graph(structraw_object_store*);
voidfree_commit_graph(structcommit_graph*);
/*
* Disable further use of the commit graph in this process when parsing a
* "struct commit".
*/
voiddisable_commit_graph(structrepository*r);
structcommit_graph_data {
uint32_tgraph_pos;
timestamp_tgeneration;
};
/*
* Commits should be parsed before accessing generation, graph positions.
*/
timestamp_tcommit_graph_generation(conststructcommit*);
uint32_tcommit_graph_position(conststructcommit*);
#endif