interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / rerere.h

72 lines · 2066 bytes Raw Blame History
1#ifndef RERERE_H
2#define RERERE_H
3
4#include "gettext.h"
5#include "lockfile.h"
6#include "string-list.h"
7#include "strmap.h"
8
9struct pathspec;
10struct repository;
11
12#define RERERE_AUTOUPDATE 01
13#define RERERE_NOAUTOUPDATE 02
14#define RERERE_READONLY 04
15/* If MERGE_RR.lock is taken, return -1 as if rerere were disabled */
16#define RERERE_NOWAIT 010
17
18/*
19 * Marks paths that have been hand-resolved and added to the
20 * index. Set in the util field of such paths after calling
21 * rerere_remaining.
22 */
23extern void *RERERE_RESOLVED;
24
25struct rerere_cache {
26 struct repository *repo;
27
28 /* Automatically update cleanly resolved paths to the index. */
29 int autoupdate;
30
31 struct strmap dirs;
32
33 struct lock_file write_lock;
34};
35
36struct rerere_dir;
37struct rerere_id {
38 struct rerere_dir *collection;
39 int variant;
40};
41
42int rerere_cache_setup(struct rerere_cache *cache,
43 struct repository *r,
44 struct string_list *merge_rr,
45 int flags);
46void rerere_cache_release(struct rerere_cache *cache);
47
48int repo_rerere(struct repository *, int);
49/*
50 * Given the conflict ID and the name of a "file" used for replaying
51 * the recorded resolution (e.g. "preimage", "postimage"), return the
52 * path to that filesystem entity. With "file" specified with NULL,
53 * return the path to the directory that houses these files.
54 */
55const char *rerere_path(struct repository *,
56 struct strbuf *buf, const struct rerere_id *,
57 const char *file);
58int rerere_forget(struct repository *, struct pathspec *);
59int rerere_remaining(struct repository *, struct string_list *);
60void rerere_clear(struct repository *, struct string_list *);
61void rerere_gc(struct repository *, struct string_list *, int);
62
63/*
64 * Check whether garbage collection for rerere entries is needed, which is
65 * the case when there's at least `limit` stale entries that would be pruned.
66 */
67bool rerere_gc_needed(struct repository *r, size_t limit);
68
69#define OPT_RERERE_AUTOUPDATE(v) OPT_UYN(0, "rerere-autoupdate", (v), \
70 N_("update the index with reused conflict resolution if possible"))
71
72#endif