2006-09-08 12:05:34 +04:00
|
|
|
#ifndef STATUS_H
|
|
|
|
#define STATUS_H
|
|
|
|
|
2007-09-18 04:06:42 +04:00
|
|
|
#include <stdio.h>
|
2009-08-05 10:49:33 +04:00
|
|
|
#include "string-list.h"
|
2009-08-10 10:08:40 +04:00
|
|
|
#include "color.h"
|
2007-09-18 04:06:42 +04:00
|
|
|
|
2006-09-08 12:05:34 +04:00
|
|
|
enum color_wt_status {
|
2009-08-10 10:08:40 +04:00
|
|
|
WT_STATUS_HEADER = 0,
|
2006-09-08 12:05:34 +04:00
|
|
|
WT_STATUS_UPDATED,
|
|
|
|
WT_STATUS_CHANGED,
|
|
|
|
WT_STATUS_UNTRACKED,
|
2008-05-22 16:50:02 +04:00
|
|
|
WT_STATUS_NOBRANCH,
|
2009-08-05 11:04:51 +04:00
|
|
|
WT_STATUS_UNMERGED,
|
2010-05-25 17:45:51 +04:00
|
|
|
WT_STATUS_LOCAL_BRANCH,
|
2010-06-21 17:02:44 +04:00
|
|
|
WT_STATUS_REMOTE_BRANCH
|
2006-09-08 12:05:34 +04:00
|
|
|
};
|
|
|
|
|
2008-06-05 12:31:19 +04:00
|
|
|
enum untracked_status_type {
|
2008-06-05 16:22:56 +04:00
|
|
|
SHOW_NO_UNTRACKED_FILES,
|
|
|
|
SHOW_NORMAL_UNTRACKED_FILES,
|
2008-06-05 12:31:19 +04:00
|
|
|
SHOW_ALL_UNTRACKED_FILES
|
|
|
|
};
|
|
|
|
|
2009-08-05 10:49:33 +04:00
|
|
|
struct wt_status_change_data {
|
|
|
|
int worktree_status;
|
|
|
|
int index_status;
|
|
|
|
int stagemask;
|
|
|
|
char *head_path;
|
2010-03-08 15:53:19 +03:00
|
|
|
unsigned dirty_submodule : 2;
|
|
|
|
unsigned new_submodule_commits : 1;
|
2009-08-05 10:49:33 +04:00
|
|
|
};
|
|
|
|
|
2006-09-08 12:05:34 +04:00
|
|
|
struct wt_status {
|
|
|
|
int is_initial;
|
|
|
|
char *branch;
|
|
|
|
const char *reference;
|
2009-08-08 10:31:57 +04:00
|
|
|
const char **pathspec;
|
2006-09-08 12:05:34 +04:00
|
|
|
int verbose;
|
|
|
|
int amend;
|
2009-12-12 10:53:41 +03:00
|
|
|
int in_merge;
|
2007-12-13 06:09:16 +03:00
|
|
|
int nowarn;
|
2009-08-10 08:59:30 +04:00
|
|
|
int use_color;
|
|
|
|
int relative_paths;
|
|
|
|
int submodule_summary;
|
2010-04-10 11:11:53 +04:00
|
|
|
int show_ignored_files;
|
2009-08-10 08:59:30 +04:00
|
|
|
enum untracked_status_type show_untracked_files;
|
2010-06-25 18:56:47 +04:00
|
|
|
const char *ignore_submodule_arg;
|
2010-05-25 17:45:51 +04:00
|
|
|
char color_palette[WT_STATUS_REMOTE_BRANCH+1][COLOR_MAXLEN];
|
2009-08-10 08:59:30 +04:00
|
|
|
|
2007-01-11 01:25:03 +03:00
|
|
|
/* These are computed during processing of the individual sections */
|
|
|
|
int commitable;
|
|
|
|
int workdir_dirty;
|
2007-09-18 04:06:43 +04:00
|
|
|
const char *index_file;
|
2007-09-18 04:06:42 +04:00
|
|
|
FILE *fp;
|
2007-11-11 20:35:41 +03:00
|
|
|
const char *prefix;
|
2009-08-05 10:49:33 +04:00
|
|
|
struct string_list change;
|
2009-08-10 11:36:33 +04:00
|
|
|
struct string_list untracked;
|
2010-04-10 11:11:53 +04:00
|
|
|
struct string_list ignored;
|
2006-09-08 12:05:34 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
void wt_status_prepare(struct wt_status *s);
|
|
|
|
void wt_status_print(struct wt_status *s);
|
2009-08-10 11:36:33 +04:00
|
|
|
void wt_status_collect(struct wt_status *s);
|
2006-09-08 12:05:34 +04:00
|
|
|
|
2010-05-25 17:45:51 +04:00
|
|
|
void wt_shortstatus_print(struct wt_status *s, int null_termination, int show_branch);
|
2009-12-07 08:17:15 +03:00
|
|
|
void wt_porcelain_print(struct wt_status *s, int null_termination);
|
2009-12-05 18:04:37 +03:00
|
|
|
|
2006-09-08 12:05:34 +04:00
|
|
|
#endif /* STATUS_H */
|