@@ -1242,16 +1242,14 @@ static int parse_and_validate_options(int argc, const char *argv[],
1242
1242
struct commit * current_head ,
1243
1243
struct wt_status * s )
1244
1244
{
1245
- int f = 0 ;
1246
-
1247
1245
argc = parse_options (argc , argv , prefix , options , usage , 0 );
1248
1246
finalize_deferred_config (s );
1249
1247
1250
1248
if (force_author && !strchr (force_author , '>' ))
1251
1249
force_author = find_author_by_nickname (force_author );
1252
1250
1253
1251
if (force_author && renew_authorship )
1254
- die (_ ("Using both --reset-author and --author does not make sense" ) );
1252
+ die (_ ("options '%s' and '%s' cannot be used together" ), " --reset-author" , " --author" );
1255
1253
1256
1254
if (logfile || have_option_m || use_message )
1257
1255
use_editor = 0 ;
@@ -1268,20 +1266,16 @@ static int parse_and_validate_options(int argc, const char *argv[],
1268
1266
die (_ ("You are in the middle of a rebase -- cannot amend." ));
1269
1267
}
1270
1268
if (fixup_message && squash_message )
1271
- die (_ ("Options --squash and --fixup cannot be used together" ));
1272
- if (use_message )
1273
- f ++ ;
1274
- if (edit_message )
1275
- f ++ ;
1276
- if (fixup_message )
1277
- f ++ ;
1278
- if (logfile )
1279
- f ++ ;
1280
- if (f > 1 )
1281
- die (_ ("Only one of -c/-C/-F/--fixup can be used." ));
1282
- if (have_option_m && (edit_message || use_message || logfile ))
1283
- die ((_ ("Option -m cannot be combined with -c/-C/-F." )));
1284
- if (f || have_option_m )
1269
+ die (_ ("options '%s' and '%s' cannot be used together" ), "--squash" , "--fixup" );
1270
+ die_for_incompatible_opt4 (!!use_message , "-C" ,
1271
+ !!edit_message , "-c" ,
1272
+ !!logfile , "-F" ,
1273
+ !!fixup_message , "--fixup" );
1274
+ die_for_incompatible_opt4 (have_option_m , "-m" ,
1275
+ !!edit_message , "-c" ,
1276
+ !!use_message , "-C" ,
1277
+ !!logfile , "-F" );
1278
+ if (use_message || edit_message || logfile || fixup_message || have_option_m )
1285
1279
template_file = NULL ;
1286
1280
if (edit_message )
1287
1281
use_message = edit_message ;
@@ -1306,9 +1300,10 @@ static int parse_and_validate_options(int argc, const char *argv[],
1306
1300
if (patch_interactive )
1307
1301
interactive = 1 ;
1308
1302
1309
- if (also + only + all + interactive > 1 )
1310
- die (_ ("Only one of --include/--only/--all/--interactive/--patch can be used." ));
1311
-
1303
+ die_for_incompatible_opt4 (also , "-i/--include" ,
1304
+ only , "-o/--only" ,
1305
+ all , "-a/--all" ,
1306
+ interactive , "--interactive/-p/--patch" );
1312
1307
if (fixup_message ) {
1313
1308
/*
1314
1309
* We limit --fixup's suboptions to only alpha characters.
0 commit comments