@@ -112,10 +112,11 @@ static const char *only_include_assumed;
112112static struct strbuf message = STRBUF_INIT ;
113113
114114static enum {
115+ STATUS_FORMAT_NONE = 0 ,
115116 STATUS_FORMAT_LONG ,
116117 STATUS_FORMAT_SHORT ,
117118 STATUS_FORMAT_PORCELAIN
118- } status_format = STATUS_FORMAT_LONG ;
119+ } status_format ;
119120
120121static int opt_parse_m (const struct option * opt , const char * arg , int unset )
121122{
@@ -454,6 +455,7 @@ static int run_status(FILE *fp, const char *index_file, const char *prefix, int
454455 case STATUS_FORMAT_PORCELAIN :
455456 wt_porcelain_print (s );
456457 break ;
458+ case STATUS_FORMAT_NONE :
457459 case STATUS_FORMAT_LONG :
458460 wt_status_print (s );
459461 break ;
@@ -1058,9 +1060,13 @@ static int parse_and_validate_options(int argc, const char *argv[],
10581060 if (all && argc > 0 )
10591061 die (_ ("Paths with -a does not make sense." ));
10601062
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 )
10641070 dry_run = 1 ;
10651071
10661072 return argc ;
@@ -1159,6 +1165,9 @@ int cmd_status(int argc, const char **argv, const char *prefix)
11591165 OPT_SET_INT (0 , "porcelain" , & status_format ,
11601166 N_ ("machine-readable output" ),
11611167 STATUS_FORMAT_PORCELAIN ),
1168+ OPT_SET_INT (0 , "long" , & status_format ,
1169+ N_ ("show status in long format (default)" ),
1170+ STATUS_FORMAT_LONG ),
11621171 OPT_BOOLEAN ('z' , "null" , & s .null_termination ,
11631172 N_ ("terminate entries with NUL" )),
11641173 { OPTION_STRING , 'u' , "untracked-files" , & untracked_files_arg ,
@@ -1186,8 +1195,12 @@ int cmd_status(int argc, const char **argv, const char *prefix)
11861195 builtin_status_usage , 0 );
11871196 finalize_colopts (& s .colopts , -1 );
11881197
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+ }
11911204
11921205 handle_untracked_files_arg (& s );
11931206 if (show_ignored_in_status )
@@ -1216,6 +1229,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
12161229 case STATUS_FORMAT_PORCELAIN :
12171230 wt_porcelain_print (& s );
12181231 break ;
1232+ case STATUS_FORMAT_NONE :
12191233 case STATUS_FORMAT_LONG :
12201234 s .verbose = verbose ;
12211235 s .ignore_submodule_arg = ignore_submodule_arg ;
@@ -1386,6 +1400,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
13861400 OPT_BOOLEAN (0 , "branch" , & s .show_branch , N_ ("show branch information" )),
13871401 OPT_SET_INT (0 , "porcelain" , & status_format ,
13881402 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 ),
13891406 OPT_BOOLEAN ('z' , "null" , & s .null_termination ,
13901407 N_ ("terminate entries with NUL" )),
13911408 OPT_BOOLEAN (0 , "amend" , & amend , N_ ("amend previous commit" )),
0 commit comments