@@ -1242,16 +1242,14 @@ static int parse_and_validate_options(int argc, const char *argv[],
12421242 struct commit * current_head ,
12431243 struct wt_status * s )
12441244{
1245- int f = 0 ;
1246-
12471245 argc = parse_options (argc , argv , prefix , options , usage , 0 );
12481246 finalize_deferred_config (s );
12491247
12501248 if (force_author && !strchr (force_author , '>' ))
12511249 force_author = find_author_by_nickname (force_author );
12521250
12531251 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" );
12551253
12561254 if (logfile || have_option_m || use_message )
12571255 use_editor = 0 ;
@@ -1268,20 +1266,16 @@ static int parse_and_validate_options(int argc, const char *argv[],
12681266 die (_ ("You are in the middle of a rebase -- cannot amend." ));
12691267 }
12701268 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 )
12851279 template_file = NULL ;
12861280 if (edit_message )
12871281 use_message = edit_message ;
@@ -1306,9 +1300,10 @@ static int parse_and_validate_options(int argc, const char *argv[],
13061300 if (patch_interactive )
13071301 interactive = 1 ;
13081302
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" );
13121307 if (fixup_message ) {
13131308 /*
13141309 * We limit --fixup's suboptions to only alpha characters.
0 commit comments