blob: a0e75177bec925e95b4257811aae0bdee93c41f1 [file] [log] [blame]
Jeff Kingc91f0d92006-09-08 04:05:34 -04001#ifndef STATUS_H
2#define STATUS_H
3
Kristian Høgsbergf26a0012007-09-17 20:06:42 -04004#include <stdio.h>
Junio C Hamano50b7e702009-08-04 23:49:33 -07005#include "string-list.h"
Junio C Hamano23900a92009-08-09 23:08:40 -07006#include "color.h"
Kristian Høgsbergf26a0012007-09-17 20:06:42 -04007
Jeff Kingc91f0d92006-09-08 04:05:34 -04008enum color_wt_status {
Junio C Hamano23900a92009-08-09 23:08:40 -07009 WT_STATUS_HEADER = 0,
Jeff Kingc91f0d92006-09-08 04:05:34 -040010 WT_STATUS_UPDATED,
11 WT_STATUS_CHANGED,
12 WT_STATUS_UNTRACKED,
Chris Parsons950ce2e2008-05-22 08:50:02 -040013 WT_STATUS_NOBRANCH,
Junio C Hamano4d4d5722009-08-05 00:04:51 -070014 WT_STATUS_UNMERGED,
Jeff Kingc91f0d92006-09-08 04:05:34 -040015};
16
Marius Storm-Olsen4bfee302008-06-05 10:31:19 +020017enum untracked_status_type {
Marius Storm-Olsen6c2ce042008-06-05 14:22:56 +020018 SHOW_NO_UNTRACKED_FILES,
19 SHOW_NORMAL_UNTRACKED_FILES,
Marius Storm-Olsen4bfee302008-06-05 10:31:19 +020020 SHOW_ALL_UNTRACKED_FILES
21};
Marius Storm-Olsen4bfee302008-06-05 10:31:19 +020022
Junio C Hamano50b7e702009-08-04 23:49:33 -070023struct wt_status_change_data {
24 int worktree_status;
25 int index_status;
26 int stagemask;
27 char *head_path;
28};
29
Jeff Kingc91f0d92006-09-08 04:05:34 -040030struct wt_status {
31 int is_initial;
32 char *branch;
33 const char *reference;
Jeff Kingc91f0d92006-09-08 04:05:34 -040034 int verbose;
35 int amend;
Junio C Hamano37d07f82007-12-12 19:09:16 -080036 int nowarn;
Junio C Hamanod249b092009-08-09 21:59:30 -070037 int use_color;
38 int relative_paths;
39 int submodule_summary;
40 enum untracked_status_type show_untracked_files;
Junio C Hamano23900a92009-08-09 23:08:40 -070041 char color_palette[WT_STATUS_UNMERGED+1][COLOR_MAXLEN];
Junio C Hamanod249b092009-08-09 21:59:30 -070042
Jürgen Rühle2a3a3c22007-01-10 23:25:03 +010043 /* These are computed during processing of the individual sections */
44 int commitable;
45 int workdir_dirty;
46 int workdir_untracked;
Kristian Høgsberg0f729f22007-09-17 20:06:43 -040047 const char *index_file;
Kristian Høgsbergf26a0012007-09-17 20:06:42 -040048 FILE *fp;
Johannes Schindelin367c9882007-11-11 17:35:41 +000049 const char *prefix;
Junio C Hamano50b7e702009-08-04 23:49:33 -070050 struct string_list change;
Junio C Hamano76378682009-08-10 00:36:33 -070051 struct string_list untracked;
Jeff Kingc91f0d92006-09-08 04:05:34 -040052};
53
Jeff Kingc91f0d92006-09-08 04:05:34 -040054void wt_status_prepare(struct wt_status *s);
55void wt_status_print(struct wt_status *s);
Junio C Hamano76378682009-08-10 00:36:33 -070056void wt_status_collect(struct wt_status *s);
Jeff Kingc91f0d92006-09-08 04:05:34 -040057
58#endif /* STATUS_H */