112
static struct strbuf message = STRBUF_INIT;
113
114
static enum {
115
+ STATUS_FORMAT_NONE = 0,
116
STATUS_FORMAT_LONG,
117
STATUS_FORMAT_SHORT,
118
STATUS_FORMAT_PORCELAIN
118
-} status_format = STATUS_FORMAT_LONG;
119
+} status_format;
120
121
static int opt_parse_m(const struct option *opt, const char *arg, int unset)
122
{
455
case STATUS_FORMAT_PORCELAIN:
456
wt_porcelain_print(s);
457
break;
458
+ case STATUS_FORMAT_NONE:
459
case STATUS_FORMAT_LONG:
460
wt_status_print(s);
461
break;
1060
if (all && argc > 0)
1061
die(_("Paths with -a does not make sense."));
1062
1061
- if (s->null_termination && status_format == STATUS_FORMAT_LONG)
1062
- status_format = STATUS_FORMAT_PORCELAIN;
1063
- if (status_format != STATUS_FORMAT_LONG)
1063
+ if (s->null_termination) {
1064
+ if (status_format == STATUS_FORMAT_NONE)
1065
+ status_format = STATUS_FORMAT_PORCELAIN;
1066
+ else if (status_format == STATUS_FORMAT_LONG)
1067
+ die(_("--long and -z are incompatible"));
1068
+ }
1069
+ if (status_format != STATUS_FORMAT_NONE)
1070
dry_run = 1;
1071
1072
return argc;
1165
OPT_SET_INT(0, "porcelain", &status_format,
1166
N_("machine-readable output"),
1167
STATUS_FORMAT_PORCELAIN),
1168
+ OPT_SET_INT(0, "long", &status_format,
1169
+ N_("show status in long format (default)"),
1170
+ STATUS_FORMAT_LONG),
1171
OPT_BOOLEAN('z', "null", &s.null_termination,
1172
N_("terminate entries with NUL")),
1173
{ OPTION_STRING, 'u', "untracked-files", &untracked_files_arg,
1195
builtin_status_usage, 0);
1196
finalize_colopts(&s.colopts, -1);
1197
1189
- if (s.null_termination && status_format == STATUS_FORMAT_LONG)
1190
- status_format = STATUS_FORMAT_PORCELAIN;
1198
+ if (s.null_termination) {
1199
+ if (status_format == STATUS_FORMAT_NONE)
1200
+ status_format = STATUS_FORMAT_PORCELAIN;
1201
+ else if (status_format == STATUS_FORMAT_LONG)
1202
+ die(_("--long and -z are incompatible"));
1203
+ }
1204
1205
handle_untracked_files_arg(&s);
1206
if (show_ignored_in_status)
1229
case STATUS_FORMAT_PORCELAIN:
1230
wt_porcelain_print(&s);
1231
break;
1232
+ case STATUS_FORMAT_NONE:
1233
case STATUS_FORMAT_LONG:
1234
s.verbose = verbose;
1235
s.ignore_submodule_arg = ignore_submodule_arg;
1400
OPT_BOOLEAN(0, "branch", &s.show_branch, N_("show branch information")),
1401
OPT_SET_INT(0, "porcelain", &status_format,
1402
N_("machine-readable output"), STATUS_FORMAT_PORCELAIN),
1403
+ OPT_SET_INT(0, "long", &status_format,
1404
+ N_("show status in long format (default)"),
1405
+ STATUS_FORMAT_LONG),
1406
OPT_BOOLEAN('z', "null", &s.null_termination,
1407
N_("terminate entries with NUL")),
1408
OPT_BOOLEAN(0, "amend", &amend, N_("amend previous commit")),