]> git.ipfire.org Git - thirdparty/git.git/blob - shallow.h
shallow.h: document '{commit,rollback}_shallow_file'
[thirdparty/git.git] / shallow.h
1 #ifndef SHALLOW_H
2 #define SHALLOW_H
3
4 #include "lockfile.h"
5 #include "object.h"
6 #include "repository.h"
7 #include "strbuf.h"
8
9 void set_alternate_shallow_file(struct repository *r, const char *path, int override);
10 int register_shallow(struct repository *r, const struct object_id *oid);
11 int unregister_shallow(const struct object_id *oid);
12 int is_repository_shallow(struct repository *r);
13 /* commit $GIT_DIR/shallow and reset stat-validity checks */
14 int commit_shallow_file(struct repository *r, struct lock_file *lk);
15 /* rollback $GIT_DIR/shallow and reset stat-validity checks */
16 void rollback_shallow_file(struct repository *r, struct lock_file *lk);
17
18 struct commit_list *get_shallow_commits(struct object_array *heads,
19 int depth, int shallow_flag, int not_shallow_flag);
20 struct commit_list *get_shallow_commits_by_rev_list(
21 int ac, const char **av, int shallow_flag, int not_shallow_flag);
22 int write_shallow_commits(struct strbuf *out, int use_pack_protocol,
23 const struct oid_array *extra);
24
25 void setup_alternate_shallow(struct lock_file *shallow_lock,
26 const char **alternate_shallow_file,
27 const struct oid_array *extra);
28
29 const char *setup_temporary_shallow(const struct oid_array *extra);
30
31 void advertise_shallow_grafts(int);
32
33 #define PRUNE_SHOW_ONLY 1
34 #define PRUNE_QUICK 2
35 void prune_shallow(unsigned options);
36
37 /*
38 * Initialize with prepare_shallow_info() or zero-initialize (equivalent to
39 * prepare_shallow_info with a NULL oid_array).
40 */
41 struct shallow_info {
42 struct oid_array *shallow;
43 int *ours, nr_ours;
44 int *theirs, nr_theirs;
45 struct oid_array *ref;
46
47 /* for receive-pack */
48 uint32_t **used_shallow;
49 int *need_reachability_test;
50 int *reachable;
51 int *shallow_ref;
52 struct commit **commits;
53 int nr_commits;
54 };
55
56 void prepare_shallow_info(struct shallow_info *, struct oid_array *);
57 void clear_shallow_info(struct shallow_info *);
58 void remove_nonexistent_theirs_shallow(struct shallow_info *);
59 void assign_shallow_commits_to_refs(struct shallow_info *info,
60 uint32_t **used,
61 int *ref_status);
62 int delayed_reachability_test(struct shallow_info *si, int c);
63
64 extern struct trace_key trace_shallow;
65
66 #endif /* SHALLOW_H */