at commit e77f412d

1 #ifndef RERERE_H
2 #define RERERE_H
3
4 #include "gettext.h"
5 #include "string-list.h"
6
7 struct pathspec;
8 struct repository;
9
10 #define RERERE_AUTOUPDATE 01
11 #define RERERE_NOAUTOUPDATE 02
12 #define RERERE_READONLY 04
13
14 /*
15 * Marks paths that have been hand-resolved and added to the
16 * index. Set in the util field of such paths after calling
17 * rerere_remaining.
18 */
19 extern void *RERERE_RESOLVED;
20
21 struct rerere_dir;
22 struct rerere_id {
23 struct rerere_dir *collection;
24 int variant;
25 };
26
27 int setup_rerere(struct repository *,struct string_list *, int);
28 int repo_rerere(struct repository *, int);
29 /*
30 * Given the conflict ID and the name of a "file" used for replaying
31 * the recorded resolution (e.g. "preimage", "postimage"), return the
32 * path to that filesystem entity. With "file" specified with NULL,
33 * return the path to the directory that houses these files.
34 */
35 const char *rerere_path(struct strbuf *buf, const struct rerere_id *,
36 const char *file);
37 int rerere_forget(struct repository *, struct pathspec *);
38 int rerere_remaining(struct repository *, struct string_list *);
39 void rerere_clear(struct repository *, struct string_list *);
40 void rerere_gc(struct repository *, struct string_list *);
41
42 /*
43 * Check whether garbage collection for rerere entries is needed, which is
44 * the case when there's at least `limit` stale entries that would be pruned.
45 */
46 bool rerere_gc_needed(struct repository *r, size_t limit);
47
48 #define OPT_RERERE_AUTOUPDATE(v) OPT_UYN(0, "rerere-autoupdate", (v), \
49 N_("update the index with reused conflict resolution if possible"))
50
51 #endif