Jeff King | c91f0d9 | 2006-09-08 04:05:34 -0400 | [diff] [blame] | 1 | #ifndef STATUS_H |
| 2 | #define STATUS_H |
| 3 | |
Kristian Høgsberg | f26a001 | 2007-09-17 20:06:42 -0400 | [diff] [blame] | 4 | #include <stdio.h> |
Junio C Hamano | 50b7e70 | 2009-08-04 23:49:33 -0700 | [diff] [blame] | 5 | #include "string-list.h" |
Junio C Hamano | 23900a9 | 2009-08-09 23:08:40 -0700 | [diff] [blame] | 6 | #include "color.h" |
Kristian Høgsberg | f26a001 | 2007-09-17 20:06:42 -0400 | [diff] [blame] | 7 | |
Jeff King | c91f0d9 | 2006-09-08 04:05:34 -0400 | [diff] [blame] | 8 | enum color_wt_status { |
Junio C Hamano | 23900a9 | 2009-08-09 23:08:40 -0700 | [diff] [blame] | 9 | WT_STATUS_HEADER = 0, |
Jeff King | c91f0d9 | 2006-09-08 04:05:34 -0400 | [diff] [blame] | 10 | WT_STATUS_UPDATED, |
| 11 | WT_STATUS_CHANGED, |
| 12 | WT_STATUS_UNTRACKED, |
Chris Parsons | 950ce2e | 2008-05-22 08:50:02 -0400 | [diff] [blame] | 13 | WT_STATUS_NOBRANCH, |
Junio C Hamano | 4d4d572 | 2009-08-05 00:04:51 -0700 | [diff] [blame] | 14 | WT_STATUS_UNMERGED, |
Jeff King | c91f0d9 | 2006-09-08 04:05:34 -0400 | [diff] [blame] | 15 | }; |
| 16 | |
Marius Storm-Olsen | 4bfee30 | 2008-06-05 10:31:19 +0200 | [diff] [blame] | 17 | enum untracked_status_type { |
Marius Storm-Olsen | 6c2ce04 | 2008-06-05 14:22:56 +0200 | [diff] [blame] | 18 | SHOW_NO_UNTRACKED_FILES, |
| 19 | SHOW_NORMAL_UNTRACKED_FILES, |
Marius Storm-Olsen | 4bfee30 | 2008-06-05 10:31:19 +0200 | [diff] [blame] | 20 | SHOW_ALL_UNTRACKED_FILES |
| 21 | }; |
Marius Storm-Olsen | 4bfee30 | 2008-06-05 10:31:19 +0200 | [diff] [blame] | 22 | |
Junio C Hamano | 50b7e70 | 2009-08-04 23:49:33 -0700 | [diff] [blame] | 23 | struct wt_status_change_data { |
| 24 | int worktree_status; |
| 25 | int index_status; |
| 26 | int stagemask; |
| 27 | char *head_path; |
| 28 | }; |
| 29 | |
Jeff King | c91f0d9 | 2006-09-08 04:05:34 -0400 | [diff] [blame] | 30 | struct wt_status { |
| 31 | int is_initial; |
| 32 | char *branch; |
| 33 | const char *reference; |
Jeff King | c91f0d9 | 2006-09-08 04:05:34 -0400 | [diff] [blame] | 34 | int verbose; |
| 35 | int amend; |
Junio C Hamano | 37d07f8 | 2007-12-12 19:09:16 -0800 | [diff] [blame] | 36 | int nowarn; |
Junio C Hamano | d249b09 | 2009-08-09 21:59:30 -0700 | [diff] [blame] | 37 | int use_color; |
| 38 | int relative_paths; |
| 39 | int submodule_summary; |
| 40 | enum untracked_status_type show_untracked_files; |
Junio C Hamano | 23900a9 | 2009-08-09 23:08:40 -0700 | [diff] [blame] | 41 | char color_palette[WT_STATUS_UNMERGED+1][COLOR_MAXLEN]; |
Junio C Hamano | d249b09 | 2009-08-09 21:59:30 -0700 | [diff] [blame] | 42 | |
Jürgen Rühle | 2a3a3c2 | 2007-01-10 23:25:03 +0100 | [diff] [blame] | 43 | /* These are computed during processing of the individual sections */ |
| 44 | int commitable; |
| 45 | int workdir_dirty; |
| 46 | int workdir_untracked; |
Kristian Høgsberg | 0f729f2 | 2007-09-17 20:06:43 -0400 | [diff] [blame] | 47 | const char *index_file; |
Kristian Høgsberg | f26a001 | 2007-09-17 20:06:42 -0400 | [diff] [blame] | 48 | FILE *fp; |
Johannes Schindelin | 367c988 | 2007-11-11 17:35:41 +0000 | [diff] [blame] | 49 | const char *prefix; |
Junio C Hamano | 50b7e70 | 2009-08-04 23:49:33 -0700 | [diff] [blame] | 50 | struct string_list change; |
Junio C Hamano | 7637868 | 2009-08-10 00:36:33 -0700 | [diff] [blame] | 51 | struct string_list untracked; |
Jeff King | c91f0d9 | 2006-09-08 04:05:34 -0400 | [diff] [blame] | 52 | }; |
| 53 | |
Jeff King | c91f0d9 | 2006-09-08 04:05:34 -0400 | [diff] [blame] | 54 | void wt_status_prepare(struct wt_status *s); |
| 55 | void wt_status_print(struct wt_status *s); |
Junio C Hamano | 7637868 | 2009-08-10 00:36:33 -0700 | [diff] [blame] | 56 | void wt_status_collect(struct wt_status *s); |
Jeff King | c91f0d9 | 2006-09-08 04:05:34 -0400 | [diff] [blame] | 57 | |
| 58 | #endif /* STATUS_H */ |