Stephan Beyer | 5b2fd95 | 2008-07-09 14:58:57 +0200 | [diff] [blame] | 1 | #ifndef RERERE_H |
| 2 | #define RERERE_H |
| 3 | |
Elijah Newren | f394e09 | 2023-03-21 06:25:54 +0000 | [diff] [blame] | 4 | #include "gettext.h" |
Johannes Schindelin | c455c87 | 2008-07-21 19:03:49 +0100 | [diff] [blame] | 5 | #include "string-list.h" |
Stephan Beyer | 5b2fd95 | 2008-07-09 14:58:57 +0200 | [diff] [blame] | 6 | |
Nguyễn Thái Ngọc Duy | 01a10b0 | 2013-07-14 15:35:40 +0700 | [diff] [blame] | 7 | struct pathspec; |
Nguyễn Thái Ngọc Duy | 35843b1 | 2018-09-21 17:57:32 +0200 | [diff] [blame] | 8 | struct repository; |
Nguyễn Thái Ngọc Duy | 01a10b0 | 2013-07-14 15:35:40 +0700 | [diff] [blame] | 9 | |
Junio C Hamano | cb6020b | 2009-12-04 00:20:48 -0800 | [diff] [blame] | 10 | #define RERERE_AUTOUPDATE 01 |
| 11 | #define RERERE_NOAUTOUPDATE 02 |
Jeff King | 9dd330e | 2015-09-01 18:14:09 -0400 | [diff] [blame] | 12 | #define RERERE_READONLY 04 |
Junio C Hamano | cb6020b | 2009-12-04 00:20:48 -0800 | [diff] [blame] | 13 | |
Martin von Zweigbergk | ac49f5c | 2011-02-16 05:47:44 -0500 | [diff] [blame] | 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 | |
Junio C Hamano | 1869bbe | 2015-07-16 14:50:05 -0700 | [diff] [blame] | 21 | struct rerere_dir; |
Junio C Hamano | 1d51ece | 2015-07-04 17:38:34 -0700 | [diff] [blame] | 22 | struct rerere_id { |
Junio C Hamano | 1869bbe | 2015-07-16 14:50:05 -0700 | [diff] [blame] | 23 | struct rerere_dir *collection; |
Junio C Hamano | a13d137 | 2015-07-23 14:23:24 -0700 | [diff] [blame] | 24 | int variant; |
Junio C Hamano | 1d51ece | 2015-07-04 17:38:34 -0700 | [diff] [blame] | 25 | }; |
| 26 | |
Nguyễn Thái Ngọc Duy | 55e6b35 | 2018-11-10 06:49:09 +0100 | [diff] [blame] | 27 | int setup_rerere(struct repository *,struct string_list *, int); |
Nguyễn Thái Ngọc Duy | 35843b1 | 2018-09-21 17:57:32 +0200 | [diff] [blame] | 28 | int repo_rerere(struct repository *, int); |
Junio C Hamano | 1d51ece | 2015-07-04 17:38:34 -0700 | [diff] [blame] | 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 | */ |
Nguyễn Thái Ngọc Duy | d2865da | 2018-06-30 11:20:28 +0200 | [diff] [blame] | 35 | const char *rerere_path(const struct rerere_id *, const char *file); |
Nguyễn Thái Ngọc Duy | 35843b1 | 2018-09-21 17:57:32 +0200 | [diff] [blame] | 36 | int rerere_forget(struct repository *, struct pathspec *); |
| 37 | int rerere_remaining(struct repository *, struct string_list *); |
Nguyễn Thái Ngọc Duy | 55e6b35 | 2018-11-10 06:49:09 +0100 | [diff] [blame] | 38 | void rerere_clear(struct repository *, struct string_list *); |
| 39 | void rerere_gc(struct repository *, struct string_list *); |
Stephan Beyer | 5b2fd95 | 2008-07-09 14:58:57 +0200 | [diff] [blame] | 40 | |
Junio C Hamano | cb6020b | 2009-12-04 00:20:48 -0800 | [diff] [blame] | 41 | #define OPT_RERERE_AUTOUPDATE(v) OPT_UYN(0, "rerere-autoupdate", (v), \ |
Matthias Ruester | 3424a02 | 2014-09-15 00:40:53 +0200 | [diff] [blame] | 42 | N_("update the index with reused conflict resolution if possible")) |
Junio C Hamano | cb6020b | 2009-12-04 00:20:48 -0800 | [diff] [blame] | 43 | |
Stephan Beyer | 5b2fd95 | 2008-07-09 14:58:57 +0200 | [diff] [blame] | 44 | #endif |