]> git.ipfire.org Git - thirdparty/git.git/blame - shallow.h
shallow.h: document '{commit,rollback}_shallow_file'
[thirdparty/git.git] / shallow.h
CommitLineData
120ad2b0
TB
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
9void set_alternate_shallow_file(struct repository *r, const char *path, int override);
10int register_shallow(struct repository *r, const struct object_id *oid);
11int unregister_shallow(const struct object_id *oid);
12int is_repository_shallow(struct repository *r);
a4101617 13/* commit $GIT_DIR/shallow and reset stat-validity checks */
120ad2b0 14int commit_shallow_file(struct repository *r, struct lock_file *lk);
a4101617 15/* rollback $GIT_DIR/shallow and reset stat-validity checks */
120ad2b0
TB
16void rollback_shallow_file(struct repository *r, struct lock_file *lk);
17
18struct commit_list *get_shallow_commits(struct object_array *heads,
19 int depth, int shallow_flag, int not_shallow_flag);
20struct commit_list *get_shallow_commits_by_rev_list(
21 int ac, const char **av, int shallow_flag, int not_shallow_flag);
22int write_shallow_commits(struct strbuf *out, int use_pack_protocol,
23 const struct oid_array *extra);
24
25void setup_alternate_shallow(struct lock_file *shallow_lock,
26 const char **alternate_shallow_file,
27 const struct oid_array *extra);
28
29const char *setup_temporary_shallow(const struct oid_array *extra);
30
31void advertise_shallow_grafts(int);
32
33#define PRUNE_SHOW_ONLY 1
34#define PRUNE_QUICK 2
35void 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 */
41struct 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
56void prepare_shallow_info(struct shallow_info *, struct oid_array *);
57void clear_shallow_info(struct shallow_info *);
58void remove_nonexistent_theirs_shallow(struct shallow_info *);
59void assign_shallow_commits_to_refs(struct shallow_info *info,
60 uint32_t **used,
61 int *ref_status);
62int delayed_reachability_test(struct shallow_info *si, int c);
63
64extern struct trace_key trace_shallow;
65
66#endif /* SHALLOW_H */