blob: 9df9c9fad2512d7c1d7d6456cdd645d641b5a089 [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,
Daniel Knittl-Frank05a59a02010-05-25 15:45:51 +020015 WT_STATUS_LOCAL_BRANCH,
Junio C Hamano8d676d82010-06-21 06:02:44 -070016 WT_STATUS_REMOTE_BRANCH
Jeff Kingc91f0d92006-09-08 04:05:34 -040017};
18
Marius Storm-Olsen4bfee302008-06-05 10:31:19 +020019enum untracked_status_type {
Marius Storm-Olsen6c2ce042008-06-05 14:22:56 +020020 SHOW_NO_UNTRACKED_FILES,
21 SHOW_NORMAL_UNTRACKED_FILES,
Marius Storm-Olsen4bfee302008-06-05 10:31:19 +020022 SHOW_ALL_UNTRACKED_FILES
23};
Marius Storm-Olsen4bfee302008-06-05 10:31:19 +020024
Junio C Hamano50b7e702009-08-04 23:49:33 -070025struct wt_status_change_data {
26 int worktree_status;
27 int index_status;
28 int stagemask;
29 char *head_path;
Jens Lehmann9297f77e62010-03-08 13:53:19 +010030 unsigned dirty_submodule : 2;
31 unsigned new_submodule_commits : 1;
Junio C Hamano50b7e702009-08-04 23:49:33 -070032};
33
Jeff Kingc91f0d92006-09-08 04:05:34 -040034struct wt_status {
35 int is_initial;
36 char *branch;
37 const char *reference;
Junio C Hamano76e2f7c2009-08-07 23:31:57 -070038 const char **pathspec;
Jeff Kingc91f0d92006-09-08 04:05:34 -040039 int verbose;
40 int amend;
Junio C Hamano3c588452009-12-11 23:53:41 -080041 int in_merge;
Junio C Hamano37d07f82007-12-12 19:09:16 -080042 int nowarn;
Junio C Hamanod249b092009-08-09 21:59:30 -070043 int use_color;
44 int relative_paths;
45 int submodule_summary;
Junio C Hamano6cb3f6b2010-04-10 00:11:53 -070046 int show_ignored_files;
Junio C Hamanod249b092009-08-09 21:59:30 -070047 enum untracked_status_type show_untracked_files;
Jens Lehmann46a958b2010-06-25 16:56:47 +020048 const char *ignore_submodule_arg;
Daniel Knittl-Frank05a59a02010-05-25 15:45:51 +020049 char color_palette[WT_STATUS_REMOTE_BRANCH+1][COLOR_MAXLEN];
Junio C Hamanod249b092009-08-09 21:59:30 -070050
Jürgen Rühle2a3a3c22007-01-10 23:25:03 +010051 /* These are computed during processing of the individual sections */
52 int commitable;
53 int workdir_dirty;
Kristian Høgsberg0f729f22007-09-17 20:06:43 -040054 const char *index_file;
Kristian Høgsbergf26a0012007-09-17 20:06:42 -040055 FILE *fp;
Johannes Schindelin367c9882007-11-11 17:35:41 +000056 const char *prefix;
Junio C Hamano50b7e702009-08-04 23:49:33 -070057 struct string_list change;
Junio C Hamano76378682009-08-10 00:36:33 -070058 struct string_list untracked;
Junio C Hamano6cb3f6b2010-04-10 00:11:53 -070059 struct string_list ignored;
Jeff Kingc91f0d92006-09-08 04:05:34 -040060};
61
Jeff Kingc91f0d92006-09-08 04:05:34 -040062void wt_status_prepare(struct wt_status *s);
63void wt_status_print(struct wt_status *s);
Junio C Hamano76378682009-08-10 00:36:33 -070064void wt_status_collect(struct wt_status *s);
Jeff Kingc91f0d92006-09-08 04:05:34 -040065
Daniel Knittl-Frank05a59a02010-05-25 15:45:51 +020066void wt_shortstatus_print(struct wt_status *s, int null_termination, int show_branch);
Jeff King4a7cc2f2009-12-07 00:17:15 -050067void wt_porcelain_print(struct wt_status *s, int null_termination);
Michael J Gruber84dbe7b2009-12-05 16:04:37 +010068
Jeff Kingc91f0d92006-09-08 04:05:34 -040069#endif /* STATUS_H */