Merge branch 'ja/i18n-similar-messages'
Similar message templates have been consolidated so that translators need to work on fewer number of messages. * ja/i18n-similar-messages: i18n: turn even more messages into "cannot be used together" ones i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom" i18n: factorize "--foo outside a repository" i18n: refactor "unrecognized %(foo) argument" strings i18n: factorize "no directory given for --foo" i18n: factorize "--foo requires --bar" and the like i18n: tag.c factorize i18n strings i18n: standardize "cannot open" and "cannot read" i18n: turn "options are incompatible" into "cannot be used together" i18n: refactor "%s, %s and %s are mutually exclusive" i18n: refactor "foo and bar are mutually exclusive"maint
						commit
						c17de5a505
					
				
							
								
								
									
										8
									
								
								apply.c
								
								
								
								
							
							
						
						
									
										8
									
								
								apply.c
								
								
								
								
							|  | @ -133,10 +133,10 @@ int check_apply_state(struct apply_state *state, int force_apply) | ||||||
| 	int is_not_gitdir = !startup_info->have_repository; | 	int is_not_gitdir = !startup_info->have_repository; | ||||||
|  |  | ||||||
| 	if (state->apply_with_reject && state->threeway) | 	if (state->apply_with_reject && state->threeway) | ||||||
| 		return error(_("--reject and --3way cannot be used together.")); | 		return error(_("options '%s' and '%s' cannot be used together"), "--reject", "--3way"); | ||||||
| 	if (state->threeway) { | 	if (state->threeway) { | ||||||
| 		if (is_not_gitdir) | 		if (is_not_gitdir) | ||||||
| 			return error(_("--3way outside a repository")); | 			return error(_("'%s' outside a repository"), "--3way"); | ||||||
| 		state->check_index = 1; | 		state->check_index = 1; | ||||||
| 	} | 	} | ||||||
| 	if (state->apply_with_reject) { | 	if (state->apply_with_reject) { | ||||||
|  | @ -147,10 +147,10 @@ int check_apply_state(struct apply_state *state, int force_apply) | ||||||
| 	if (!force_apply && (state->diffstat || state->numstat || state->summary || state->check || state->fake_ancestor)) | 	if (!force_apply && (state->diffstat || state->numstat || state->summary || state->check || state->fake_ancestor)) | ||||||
| 		state->apply = 0; | 		state->apply = 0; | ||||||
| 	if (state->check_index && is_not_gitdir) | 	if (state->check_index && is_not_gitdir) | ||||||
| 		return error(_("--index outside a repository")); | 		return error(_("'%s' outside a repository"), "--index"); | ||||||
| 	if (state->cached) { | 	if (state->cached) { | ||||||
| 		if (is_not_gitdir) | 		if (is_not_gitdir) | ||||||
| 			return error(_("--cached outside a repository")); | 			return error(_("'%s' outside a repository"), "--cached"); | ||||||
| 		state->check_index = 1; | 		state->check_index = 1; | ||||||
| 	} | 	} | ||||||
| 	if (state->ita_only && (state->check_index || is_not_gitdir)) | 	if (state->ita_only && (state->check_index || is_not_gitdir)) | ||||||
|  |  | ||||||
|  | @ -185,7 +185,7 @@ static int write_archive_entry(const struct object_id *oid, const char *base, | ||||||
|  |  | ||||||
| 	buffer = object_file_to_archive(args, path.buf, oid, mode, &type, &size); | 	buffer = object_file_to_archive(args, path.buf, oid, mode, &type, &size); | ||||||
| 	if (!buffer) | 	if (!buffer) | ||||||
| 		return error(_("cannot read %s"), oid_to_hex(oid)); | 		return error(_("cannot read '%s'"), oid_to_hex(oid)); | ||||||
| 	err = write_entry(args, oid, path.buf, path.len, mode, buffer, size); | 	err = write_entry(args, oid, path.buf, path.len, mode, buffer, size); | ||||||
| 	free(buffer); | 	free(buffer); | ||||||
| 	return err; | 	return err; | ||||||
|  | @ -338,7 +338,7 @@ int write_archive_entries(struct archiver_args *args, | ||||||
|  |  | ||||||
| 		strbuf_reset(&content); | 		strbuf_reset(&content); | ||||||
| 		if (strbuf_read_file(&content, path, info->stat.st_size) < 0) | 		if (strbuf_read_file(&content, path, info->stat.st_size) < 0) | ||||||
| 			err = error_errno(_("could not read '%s'"), path); | 			err = error_errno(_("cannot read '%s'"), path); | ||||||
| 		else | 		else | ||||||
| 			err = write_entry(args, &fake_oid, path_in_archive.buf, | 			err = write_entry(args, &fake_oid, path_in_archive.buf, | ||||||
| 					  path_in_archive.len, | 					  path_in_archive.len, | ||||||
|  | @ -577,11 +577,11 @@ static int parse_archive_args(int argc, const char **argv, | ||||||
| 	if (remote) | 	if (remote) | ||||||
| 		die(_("Unexpected option --remote")); | 		die(_("Unexpected option --remote")); | ||||||
| 	if (exec) | 	if (exec) | ||||||
| 		die(_("Option --exec can only be used together with --remote")); | 		die(_("the option '%s' requires '%s'"), "--exec", "--remote"); | ||||||
| 	if (output) | 	if (output) | ||||||
| 		die(_("Unexpected option --output")); | 		die(_("Unexpected option --output")); | ||||||
| 	if (is_remote && args->extra_files.nr) | 	if (is_remote && args->extra_files.nr) | ||||||
| 		die(_("Options --add-file and --remote cannot be used together")); | 		die(_("options '%s' and '%s' cannot be used together"), "--add-file", "--remote"); | ||||||
|  |  | ||||||
| 	if (!base) | 	if (!base) | ||||||
| 		base = ""; | 		base = ""; | ||||||
|  |  | ||||||
|  | @ -507,9 +507,9 @@ int cmd_add(int argc, const char **argv, const char *prefix) | ||||||
| 		add_interactive = 1; | 		add_interactive = 1; | ||||||
| 	if (add_interactive) { | 	if (add_interactive) { | ||||||
| 		if (show_only) | 		if (show_only) | ||||||
| 			die(_("--dry-run is incompatible with --interactive/--patch")); | 			die(_("options '%s' and '%s' cannot be used together"), "--dry-run", "--interactive/--patch"); | ||||||
| 		if (pathspec_from_file) | 		if (pathspec_from_file) | ||||||
| 			die(_("--pathspec-from-file is incompatible with --interactive/--patch")); | 			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--interactive/--patch"); | ||||||
| 		exit(interactive_add(argv + 1, prefix, patch_interactive)); | 		exit(interactive_add(argv + 1, prefix, patch_interactive)); | ||||||
| 	} | 	} | ||||||
| 	if (legacy_stash_p) { | 	if (legacy_stash_p) { | ||||||
|  | @ -526,7 +526,7 @@ int cmd_add(int argc, const char **argv, const char *prefix) | ||||||
|  |  | ||||||
| 	if (edit_interactive) { | 	if (edit_interactive) { | ||||||
| 		if (pathspec_from_file) | 		if (pathspec_from_file) | ||||||
| 			die(_("--pathspec-from-file is incompatible with --edit")); | 			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--edit"); | ||||||
| 		return(edit_patch(argc, argv, prefix)); | 		return(edit_patch(argc, argv, prefix)); | ||||||
| 	} | 	} | ||||||
| 	argc--; | 	argc--; | ||||||
|  | @ -538,10 +538,10 @@ int cmd_add(int argc, const char **argv, const char *prefix) | ||||||
| 		addremove = 0; /* "-u" was given but not "-A" */ | 		addremove = 0; /* "-u" was given but not "-A" */ | ||||||
|  |  | ||||||
| 	if (addremove && take_worktree_changes) | 	if (addremove && take_worktree_changes) | ||||||
| 		die(_("-A and -u are mutually incompatible")); | 		die(_("options '%s' and '%s' cannot be used together"), "-A", "-u"); | ||||||
|  |  | ||||||
| 	if (!show_only && ignore_missing) | 	if (!show_only && ignore_missing) | ||||||
| 		die(_("Option --ignore-missing can only be used together with --dry-run")); | 		die(_("the option '%s' requires '%s'"), "--ignore-missing", "--dry-run"); | ||||||
|  |  | ||||||
| 	if (chmod_arg && ((chmod_arg[0] != '-' && chmod_arg[0] != '+') || | 	if (chmod_arg && ((chmod_arg[0] != '-' && chmod_arg[0] != '+') || | ||||||
| 			  chmod_arg[1] != 'x' || chmod_arg[2])) | 			  chmod_arg[1] != 'x' || chmod_arg[2])) | ||||||
|  | @ -566,14 +566,14 @@ int cmd_add(int argc, const char **argv, const char *prefix) | ||||||
|  |  | ||||||
| 	if (pathspec_from_file) { | 	if (pathspec_from_file) { | ||||||
| 		if (pathspec.nr) | 		if (pathspec.nr) | ||||||
| 			die(_("--pathspec-from-file is incompatible with pathspec arguments")); | 			die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file"); | ||||||
|  |  | ||||||
| 		parse_pathspec_file(&pathspec, PATHSPEC_ATTR, | 		parse_pathspec_file(&pathspec, PATHSPEC_ATTR, | ||||||
| 				    PATHSPEC_PREFER_FULL | | 				    PATHSPEC_PREFER_FULL | | ||||||
| 				    PATHSPEC_SYMLINK_LEADING_PATH, | 				    PATHSPEC_SYMLINK_LEADING_PATH, | ||||||
| 				    prefix, pathspec_from_file, pathspec_file_nul); | 				    prefix, pathspec_from_file, pathspec_file_nul); | ||||||
| 	} else if (pathspec_file_nul) { | 	} else if (pathspec_file_nul) { | ||||||
| 		die(_("--pathspec-file-nul requires --pathspec-from-file")); | 		die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file"); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if (require_pathspec && pathspec.nr == 0) { | 	if (require_pathspec && pathspec.nr == 0) { | ||||||
|  |  | ||||||
|  | @ -2286,9 +2286,9 @@ static int parse_opt_show_current_patch(const struct option *opt, const char *ar | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if (resume->mode == RESUME_SHOW_PATCH && new_value != resume->sub_mode) | 	if (resume->mode == RESUME_SHOW_PATCH && new_value != resume->sub_mode) | ||||||
| 		return error(_("--show-current-patch=%s is incompatible with " | 		return error(_("options '%s=%s' and '%s=%s' " | ||||||
| 			       "--show-current-patch=%s"), | 					   "cannot be used together"), | ||||||
| 			     arg, valid_modes[resume->sub_mode]); | 					 "--show-current-patch", "--show-current-patch", arg, valid_modes[resume->sub_mode]); | ||||||
|  |  | ||||||
| 	resume->mode = RESUME_SHOW_PATCH; | 	resume->mode = RESUME_SHOW_PATCH; | ||||||
| 	resume->sub_mode = new_value; | 	resume->sub_mode = new_value; | ||||||
|  |  | ||||||
|  | @ -724,7 +724,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix) | ||||||
| 	finalize_colopts(&colopts, -1); | 	finalize_colopts(&colopts, -1); | ||||||
| 	if (filter.verbose) { | 	if (filter.verbose) { | ||||||
| 		if (explicitly_enable_column(colopts)) | 		if (explicitly_enable_column(colopts)) | ||||||
| 			die(_("--column and --verbose are incompatible")); | 			die(_("options '%s' and '%s' cannot be used together"), "--column", "--verbose"); | ||||||
| 		colopts = 0; | 		colopts = 0; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -729,7 +729,7 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix) | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if (force_path && batch.enabled) { | 	if (force_path && batch.enabled) { | ||||||
| 		error("--path=<path> incompatible with --batch"); | 		error("options '--path=<path>' and '--batch' cannot be used together"); | ||||||
| 		usage_with_options(cat_file_usage, options); | 		usage_with_options(cat_file_usage, options); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -464,10 +464,10 @@ static int checkout_paths(const struct checkout_opts *opts, | ||||||
| 		die(_("'%s' cannot be used with updating paths"), "--detach"); | 		die(_("'%s' cannot be used with updating paths"), "--detach"); | ||||||
|  |  | ||||||
| 	if (opts->merge && opts->patch_mode) | 	if (opts->merge && opts->patch_mode) | ||||||
| 		die(_("'%s' cannot be used with %s"), "--merge", "--patch"); | 		die(_("options '%s' and '%s' cannot be used together"), "--merge", "--patch"); | ||||||
|  |  | ||||||
| 	if (opts->ignore_unmerged && opts->merge) | 	if (opts->ignore_unmerged && opts->merge) | ||||||
| 		die(_("'%s' cannot be used with %s"), | 		die(_("options '%s' and '%s' cannot be used together"), | ||||||
| 		    opts->ignore_unmerged_opt, "-m"); | 		    opts->ignore_unmerged_opt, "-m"); | ||||||
|  |  | ||||||
| 	if (opts->new_branch) | 	if (opts->new_branch) | ||||||
|  | @ -1637,11 +1637,11 @@ static int checkout_main(int argc, const char **argv, const char *prefix, | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if ((!!opts->new_branch + !!opts->new_branch_force + !!opts->new_orphan_branch) > 1) | 	if ((!!opts->new_branch + !!opts->new_branch_force + !!opts->new_orphan_branch) > 1) | ||||||
| 		die(_("-%c, -%c and --orphan are mutually exclusive"), | 		die(_("options '-%c', '-%c', and '%s' cannot be used together"), | ||||||
| 				cb_option, toupper(cb_option)); | 			cb_option, toupper(cb_option), "--orphan"); | ||||||
|  |  | ||||||
| 	if (opts->overlay_mode == 1 && opts->patch_mode) | 	if (opts->overlay_mode == 1 && opts->patch_mode) | ||||||
| 		die(_("-p and --overlay are mutually exclusive")); | 		die(_("options '%s' and '%s' cannot be used together"), "-p", "--overlay"); | ||||||
|  |  | ||||||
| 	if (opts->checkout_index >= 0 || opts->checkout_worktree >= 0) { | 	if (opts->checkout_index >= 0 || opts->checkout_worktree >= 0) { | ||||||
| 		if (opts->checkout_index < 0) | 		if (opts->checkout_index < 0) | ||||||
|  | @ -1748,19 +1748,19 @@ static int checkout_main(int argc, const char **argv, const char *prefix, | ||||||
|  |  | ||||||
| 	if (opts->pathspec_from_file) { | 	if (opts->pathspec_from_file) { | ||||||
| 		if (opts->pathspec.nr) | 		if (opts->pathspec.nr) | ||||||
| 			die(_("--pathspec-from-file is incompatible with pathspec arguments")); | 			die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file"); | ||||||
|  |  | ||||||
| 		if (opts->force_detach) | 		if (opts->force_detach) | ||||||
| 			die(_("--pathspec-from-file is incompatible with --detach")); | 			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--detach"); | ||||||
|  |  | ||||||
| 		if (opts->patch_mode) | 		if (opts->patch_mode) | ||||||
| 			die(_("--pathspec-from-file is incompatible with --patch")); | 			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--patch"); | ||||||
|  |  | ||||||
| 		parse_pathspec_file(&opts->pathspec, 0, | 		parse_pathspec_file(&opts->pathspec, 0, | ||||||
| 				    0, | 				    0, | ||||||
| 				    prefix, opts->pathspec_from_file, opts->pathspec_file_nul); | 				    prefix, opts->pathspec_from_file, opts->pathspec_file_nul); | ||||||
| 	} else if (opts->pathspec_file_nul) { | 	} else if (opts->pathspec_file_nul) { | ||||||
| 		die(_("--pathspec-file-nul requires --pathspec-from-file")); | 		die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file"); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	opts->pathspec.recursive = 1; | 	opts->pathspec.recursive = 1; | ||||||
|  |  | ||||||
|  | @ -900,10 +900,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix) | ||||||
|  |  | ||||||
| 	if (option_bare) { | 	if (option_bare) { | ||||||
| 		if (option_origin) | 		if (option_origin) | ||||||
| 			die(_("--bare and --origin %s options are incompatible."), | 			die(_("options '%s' and '%s %s' cannot be used together"), | ||||||
| 			    option_origin); | 			    "--bare", "--origin", option_origin); | ||||||
| 		if (real_git_dir) | 		if (real_git_dir) | ||||||
| 			die(_("--bare and --separate-git-dir are incompatible.")); | 			die(_("options '%s' and '%s' cannot be used together"), "--bare", "--separate-git-dir"); | ||||||
| 		option_no_checkout = 1; | 		option_no_checkout = 1; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -355,19 +355,19 @@ static const char *prepare_index(const char **argv, const char *prefix, | ||||||
|  |  | ||||||
| 	if (pathspec_from_file) { | 	if (pathspec_from_file) { | ||||||
| 		if (interactive) | 		if (interactive) | ||||||
| 			die(_("--pathspec-from-file is incompatible with --interactive/--patch")); | 			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--interactive/--patch"); | ||||||
|  |  | ||||||
| 		if (all) | 		if (all) | ||||||
| 			die(_("--pathspec-from-file with -a does not make sense")); | 			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "-a"); | ||||||
|  |  | ||||||
| 		if (pathspec.nr) | 		if (pathspec.nr) | ||||||
| 			die(_("--pathspec-from-file is incompatible with pathspec arguments")); | 			die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file"); | ||||||
|  |  | ||||||
| 		parse_pathspec_file(&pathspec, 0, | 		parse_pathspec_file(&pathspec, 0, | ||||||
| 				    PATHSPEC_PREFER_FULL, | 				    PATHSPEC_PREFER_FULL, | ||||||
| 				    prefix, pathspec_from_file, pathspec_file_nul); | 				    prefix, pathspec_from_file, pathspec_file_nul); | ||||||
| 	} else if (pathspec_file_nul) { | 	} else if (pathspec_file_nul) { | ||||||
| 		die(_("--pathspec-file-nul requires --pathspec-from-file")); | 		die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file"); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if (!pathspec.nr && (also || (only && !allow_empty && | 	if (!pathspec.nr && (also || (only && !allow_empty && | ||||||
|  | @ -799,7 +799,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix, | ||||||
|  |  | ||||||
| 		if (!strcmp(fixup_prefix, "amend")) { | 		if (!strcmp(fixup_prefix, "amend")) { | ||||||
| 			if (have_option_m) | 			if (have_option_m) | ||||||
| 				die(_("cannot combine -m with --fixup:%s"), fixup_message); | 				die(_("options '%s' and '%s:%s' cannot be used together"), "-m", "--fixup", fixup_message); | ||||||
| 			prepare_amend_commit(commit, &sb, &ctx); | 			prepare_amend_commit(commit, &sb, &ctx); | ||||||
| 		} | 		} | ||||||
| 	} else if (!stat(git_path_merge_msg(the_repository), &statbuf)) { | 	} else if (!stat(git_path_merge_msg(the_repository), &statbuf)) { | ||||||
|  | @ -1193,7 +1193,7 @@ static void finalize_deferred_config(struct wt_status *s) | ||||||
| 		    status_format == STATUS_FORMAT_UNSPECIFIED) | 		    status_format == STATUS_FORMAT_UNSPECIFIED) | ||||||
| 			status_format = STATUS_FORMAT_PORCELAIN; | 			status_format = STATUS_FORMAT_PORCELAIN; | ||||||
| 		else if (status_format == STATUS_FORMAT_LONG) | 		else if (status_format == STATUS_FORMAT_LONG) | ||||||
| 			die(_("--long and -z are incompatible")); | 			die(_("options '%s' and '%s' cannot be used together"), "--long", "-z"); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if (use_deferred_config && status_format == STATUS_FORMAT_UNSPECIFIED) | 	if (use_deferred_config && status_format == STATUS_FORMAT_UNSPECIFIED) | ||||||
|  | @ -1229,9 +1229,10 @@ static void check_fixup_reword_options(int argc, const char *argv[]) { | ||||||
| 			die(_("You are in the middle of a cherry-pick -- cannot reword.")); | 			die(_("You are in the middle of a cherry-pick -- cannot reword.")); | ||||||
| 	} | 	} | ||||||
| 	if (argc) | 	if (argc) | ||||||
| 		die(_("cannot combine reword option of --fixup with path '%s'"), *argv); | 		die(_("reword option of '%s' and path '%s' cannot be used together"), "--fixup", *argv); | ||||||
| 	if (patch_interactive || interactive || all || also || only) | 	if (patch_interactive || interactive || all || also || only) | ||||||
| 		die(_("reword option of --fixup is mutually exclusive with --patch/--interactive/--all/--include/--only")); | 		die(_("reword option of '%s' and '%s' cannot be used together"), | ||||||
|  | 			"--fixup", "--patch/--interactive/--all/--include/--only"); | ||||||
| } | } | ||||||
|  |  | ||||||
| static int parse_and_validate_options(int argc, const char *argv[], | static int parse_and_validate_options(int argc, const char *argv[], | ||||||
|  |  | ||||||
|  | @ -590,7 +590,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix) | ||||||
| 	save_commit_buffer = 0; | 	save_commit_buffer = 0; | ||||||
|  |  | ||||||
| 	if (longformat && abbrev == 0) | 	if (longformat && abbrev == 0) | ||||||
| 		die(_("--long is incompatible with --abbrev=0")); | 		die(_("options '%s' and '%s' cannot be used together"), "--long", "--abbrev=0"); | ||||||
|  |  | ||||||
| 	if (contains) { | 	if (contains) { | ||||||
| 		struct string_list_item *item; | 		struct string_list_item *item; | ||||||
|  | @ -670,9 +670,9 @@ int cmd_describe(int argc, const char **argv, const char *prefix) | ||||||
| 		} | 		} | ||||||
| 		describe("HEAD", 1); | 		describe("HEAD", 1); | ||||||
| 	} else if (dirty) { | 	} else if (dirty) { | ||||||
| 		die(_("--dirty is incompatible with commit-ishes")); | 		die(_("option '%s' and commit-ishes cannot be used together"), "--dirty"); | ||||||
| 	} else if (broken) { | 	} else if (broken) { | ||||||
| 		die(_("--broken is incompatible with commit-ishes")); | 		die(_("option '%s' and commit-ishes cannot be used together"), "--broken"); | ||||||
| 	} else { | 	} else { | ||||||
| 		while (argc-- > 0) | 		while (argc-- > 0) | ||||||
| 			describe(*argv++, argc == 0); | 			describe(*argv++, argc == 0); | ||||||
|  |  | ||||||
|  | @ -152,7 +152,7 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix) | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if (read_stdin && merge_base) | 	if (read_stdin && merge_base) | ||||||
| 		die(_("--stdin and --merge-base are mutually exclusive")); | 		die(_("options '%s' and '%s' cannot be used together"), "--stdin", "--merge-base"); | ||||||
| 	if (merge_base && opt->pending.nr != 2) | 	if (merge_base && opt->pending.nr != 2) | ||||||
| 		die(_("--merge-base only works with two commits")); | 		die(_("--merge-base only works with two commits")); | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -730,10 +730,10 @@ int cmd_difftool(int argc, const char **argv, const char *prefix) | ||||||
| 		setenv(GIT_DIR_ENVIRONMENT, absolute_path(get_git_dir()), 1); | 		setenv(GIT_DIR_ENVIRONMENT, absolute_path(get_git_dir()), 1); | ||||||
| 		setenv(GIT_WORK_TREE_ENVIRONMENT, absolute_path(get_git_work_tree()), 1); | 		setenv(GIT_WORK_TREE_ENVIRONMENT, absolute_path(get_git_work_tree()), 1); | ||||||
| 	} else if (dir_diff) | 	} else if (dir_diff) | ||||||
| 		die(_("--dir-diff is incompatible with --no-index")); | 		die(_("options '%s' and '%s' cannot be used together"), "--dir-diff", "--no-index"); | ||||||
|  |  | ||||||
| 	if (use_gui_tool + !!difftool_cmd + !!extcmd > 1) | 	if (use_gui_tool + !!difftool_cmd + !!extcmd > 1) | ||||||
| 		die(_("--gui, --tool and --extcmd are mutually exclusive")); | 		die(_("options '%s', '%s', and '%s' cannot be used together"), "--gui", "--tool", "--extcmd"); | ||||||
|  |  | ||||||
| 	if (use_gui_tool) | 	if (use_gui_tool) | ||||||
| 		setenv("GIT_MERGETOOL_GUI", "true", 1); | 		setenv("GIT_MERGETOOL_GUI", "true", 1); | ||||||
|  |  | ||||||
|  | @ -1227,7 +1227,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) | ||||||
| 		usage_with_options (fast_export_usage, options); | 		usage_with_options (fast_export_usage, options); | ||||||
|  |  | ||||||
| 	if (anonymized_seeds.cmpfn && !anonymize) | 	if (anonymized_seeds.cmpfn && !anonymize) | ||||||
| 		die(_("--anonymize-map without --anonymize does not make sense")); | 		die(_("the option '%s' requires '%s'"), "--anonymize-map", "--anonymize"); | ||||||
|  |  | ||||||
| 	if (refspecs_list.nr) { | 	if (refspecs_list.nr) { | ||||||
| 		int i; | 		int i; | ||||||
|  | @ -1242,7 +1242,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) | ||||||
| 		printf("feature done\n"); | 		printf("feature done\n"); | ||||||
|  |  | ||||||
| 	if (import_filename && import_filename_if_exists) | 	if (import_filename && import_filename_if_exists) | ||||||
| 		die(_("Cannot pass both --import-marks and --import-marks-if-exists")); | 		die(_("options '%s' and '%s' cannot be used together"), "--import-marks", "--import-marks-if-exists"); | ||||||
| 	if (import_filename) | 	if (import_filename) | ||||||
| 		import_marks(import_filename, 0); | 		import_marks(import_filename, 0); | ||||||
| 	else if (import_filename_if_exists) | 	else if (import_filename_if_exists) | ||||||
|  |  | ||||||
|  | @ -996,7 +996,7 @@ static int open_fetch_head(struct fetch_head *fetch_head) | ||||||
| 	if (write_fetch_head) { | 	if (write_fetch_head) { | ||||||
| 		fetch_head->fp = fopen(filename, "a"); | 		fetch_head->fp = fopen(filename, "a"); | ||||||
| 		if (!fetch_head->fp) | 		if (!fetch_head->fp) | ||||||
| 			return error_errno(_("cannot open %s"), filename); | 			return error_errno(_("cannot open '%s'"), filename); | ||||||
| 		strbuf_init(&fetch_head->buf, 0); | 		strbuf_init(&fetch_head->buf, 0); | ||||||
| 	} else { | 	} else { | ||||||
| 		fetch_head->fp = NULL; | 		fetch_head->fp = NULL; | ||||||
|  | @ -1408,7 +1408,7 @@ static int truncate_fetch_head(void) | ||||||
| 	FILE *fp = fopen_for_writing(filename); | 	FILE *fp = fopen_for_writing(filename); | ||||||
|  |  | ||||||
| 	if (!fp) | 	if (!fp) | ||||||
| 		return error_errno(_("cannot open %s"), filename); | 		return error_errno(_("cannot open '%s'"), filename); | ||||||
| 	fclose(fp); | 	fclose(fp); | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
|  | @ -2030,12 +2030,12 @@ int cmd_fetch(int argc, const char **argv, const char *prefix) | ||||||
| 		if (deepen_relative < 0) | 		if (deepen_relative < 0) | ||||||
| 			die(_("negative depth in --deepen is not supported")); | 			die(_("negative depth in --deepen is not supported")); | ||||||
| 		if (depth) | 		if (depth) | ||||||
| 			die(_("--deepen and --depth are mutually exclusive")); | 			die(_("options '%s' and '%s' cannot be used together"), "--deepen", "--depth"); | ||||||
| 		depth = xstrfmt("%d", deepen_relative); | 		depth = xstrfmt("%d", deepen_relative); | ||||||
| 	} | 	} | ||||||
| 	if (unshallow) { | 	if (unshallow) { | ||||||
| 		if (depth) | 		if (depth) | ||||||
| 			die(_("--depth and --unshallow cannot be used together")); | 			die(_("options '%s' and '%s' cannot be used together"), "--depth", "--unshallow"); | ||||||
| 		else if (!is_repository_shallow(the_repository)) | 		else if (!is_repository_shallow(the_repository)) | ||||||
| 			die(_("--unshallow on a complete repository does not make sense")); | 			die(_("--unshallow on a complete repository does not make sense")); | ||||||
| 		else | 		else | ||||||
|  |  | ||||||
|  | @ -1845,11 +1845,11 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix) | ||||||
| 	if (!pack_name && !from_stdin) | 	if (!pack_name && !from_stdin) | ||||||
| 		usage(index_pack_usage); | 		usage(index_pack_usage); | ||||||
| 	if (fix_thin_pack && !from_stdin) | 	if (fix_thin_pack && !from_stdin) | ||||||
| 		die(_("--fix-thin cannot be used without --stdin")); | 		die(_("the option '%s' requires '%s'"), "--fix-thin", "--stdin"); | ||||||
| 	if (from_stdin && !startup_info->have_repository) | 	if (from_stdin && !startup_info->have_repository) | ||||||
| 		die(_("--stdin requires a git repository")); | 		die(_("--stdin requires a git repository")); | ||||||
| 	if (from_stdin && hash_algo) | 	if (from_stdin && hash_algo) | ||||||
| 		die(_("--object-format cannot be used with --stdin")); | 		die(_("options '%s' and '%s' cannot be used together"), "--object-format", "--stdin"); | ||||||
| 	if (!index_name && pack_name) | 	if (!index_name && pack_name) | ||||||
| 		index_name = derive_filename(pack_name, "pack", "idx", &index_name_buf); | 		index_name = derive_filename(pack_name, "pack", "idx", &index_name_buf); | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -557,7 +557,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix) | ||||||
| 	argc = parse_options(argc, argv, prefix, init_db_options, init_db_usage, 0); | 	argc = parse_options(argc, argv, prefix, init_db_options, init_db_usage, 0); | ||||||
|  |  | ||||||
| 	if (real_git_dir && is_bare_repository_cfg == 1) | 	if (real_git_dir && is_bare_repository_cfg == 1) | ||||||
| 		die(_("--separate-git-dir and --bare are mutually exclusive")); | 		die(_("options '%s' and '%s' cannot be used together"), "--separate-git-dir", "--bare"); | ||||||
|  |  | ||||||
| 	if (real_git_dir && !is_absolute_path(real_git_dir)) | 	if (real_git_dir && !is_absolute_path(real_git_dir)) | ||||||
| 		real_git_dir = real_pathdup(real_git_dir, 1); | 		real_git_dir = real_pathdup(real_git_dir, 1); | ||||||
|  |  | ||||||
|  | @ -1943,9 +1943,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) | ||||||
| 		numbered = 0; | 		numbered = 0; | ||||||
|  |  | ||||||
| 	if (numbered && keep_subject) | 	if (numbered && keep_subject) | ||||||
| 		die(_("-n and -k are mutually exclusive")); | 		die(_("options '%s' and '%s' cannot be used together"), "-n", "-k"); | ||||||
| 	if (keep_subject && subject_prefix) | 	if (keep_subject && subject_prefix) | ||||||
| 		die(_("--subject-prefix/--rfc and -k are mutually exclusive")); | 		die(_("options '%s' and '%s' cannot be used together"), "--subject-prefix/--rfc", "-k"); | ||||||
| 	rev.preserve_subject = keep_subject; | 	rev.preserve_subject = keep_subject; | ||||||
|  |  | ||||||
| 	argc = setup_revisions(argc, argv, &rev, &s_r_opt); | 	argc = setup_revisions(argc, argv, &rev, &s_r_opt); | ||||||
|  | @ -1979,7 +1979,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) | ||||||
| 		load_display_notes(&rev.notes_opt); | 		load_display_notes(&rev.notes_opt); | ||||||
|  |  | ||||||
| 	if (use_stdout + rev.diffopt.close_file + !!output_directory > 1) | 	if (use_stdout + rev.diffopt.close_file + !!output_directory > 1) | ||||||
| 		die(_("--stdout, --output, and --output-directory are mutually exclusive")); | 		die(_("options '%s', '%s', and '%s' cannot be used together"), "--stdout", "--output", "--output-directory"); | ||||||
|  |  | ||||||
| 	if (use_stdout) { | 	if (use_stdout) { | ||||||
| 		setup_pager(); | 		setup_pager(); | ||||||
|  | @ -2112,7 +2112,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) | ||||||
| 	if (creation_factor < 0) | 	if (creation_factor < 0) | ||||||
| 		creation_factor = RANGE_DIFF_CREATION_FACTOR_DEFAULT; | 		creation_factor = RANGE_DIFF_CREATION_FACTOR_DEFAULT; | ||||||
| 	else if (!rdiff_prev) | 	else if (!rdiff_prev) | ||||||
| 		die(_("--creation-factor requires --range-diff")); | 		die(_("the option '%s' requires '%s'"), "--creation-factor", "--range-diff"); | ||||||
|  |  | ||||||
| 	if (rdiff_prev) { | 	if (rdiff_prev) { | ||||||
| 		if (!cover_letter && total != 1) | 		if (!cover_letter && total != 1) | ||||||
|  |  | ||||||
|  | @ -775,7 +775,7 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix) | ||||||
| 		 * would not make any sense with this option. | 		 * would not make any sense with this option. | ||||||
| 		 */ | 		 */ | ||||||
| 		if (show_stage || show_unmerged) | 		if (show_stage || show_unmerged) | ||||||
| 			die("ls-files --with-tree is incompatible with -s or -u"); | 			die(_("options '%s' and '%s' cannot be used together"), "ls-files --with-tree", "-s/-u"); | ||||||
| 		overlay_tree_on_index(the_repository->index, with_tree, max_prefix); | 		overlay_tree_on_index(the_repository->index, with_tree, max_prefix); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -1400,9 +1400,9 @@ int cmd_merge(int argc, const char **argv, const char *prefix) | ||||||
|  |  | ||||||
| 	if (squash) { | 	if (squash) { | ||||||
| 		if (fast_forward == FF_NO) | 		if (fast_forward == FF_NO) | ||||||
| 			die(_("You cannot combine --squash with --no-ff.")); | 			die(_("options '%s' and '%s' cannot be used together"), "--squash", "--no-ff."); | ||||||
| 		if (option_commit > 0) | 		if (option_commit > 0) | ||||||
| 			die(_("You cannot combine --squash with --commit.")); | 			die(_("options '%s' and '%s' cannot be used together"), "--squash", "--commit."); | ||||||
| 		/* | 		/* | ||||||
| 		 * squash can now silently disable option_commit - this is not | 		 * squash can now silently disable option_commit - this is not | ||||||
| 		 * a problem as it is only overriding the default, not a user | 		 * a problem as it is only overriding the default, not a user | ||||||
|  |  | ||||||
|  | @ -4070,7 +4070,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix) | ||||||
| 		die(_("--thin cannot be used to build an indexable pack")); | 		die(_("--thin cannot be used to build an indexable pack")); | ||||||
|  |  | ||||||
| 	if (keep_unreachable && unpack_unreachable) | 	if (keep_unreachable && unpack_unreachable) | ||||||
| 		die(_("--keep-unreachable and --unpack-unreachable are incompatible")); | 		die(_("options '%s' and '%s' cannot be used together"), "--keep-unreachable", "--unpack-unreachable"); | ||||||
| 	if (!rev_list_all || !rev_list_reflog || !rev_list_index) | 	if (!rev_list_all || !rev_list_reflog || !rev_list_index) | ||||||
| 		unpack_unreachable_expiration = 0; | 		unpack_unreachable_expiration = 0; | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -589,7 +589,7 @@ int cmd_push(int argc, const char **argv, const char *prefix) | ||||||
| 	set_push_cert_flags(&flags, push_cert); | 	set_push_cert_flags(&flags, push_cert); | ||||||
|  |  | ||||||
| 	if (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR)))) | 	if (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR)))) | ||||||
| 		die(_("--delete is incompatible with --all, --mirror and --tags")); | 		die(_("options '%s' and '%s' cannot be used together"), "--delete", "--all/--mirror/--tags"); | ||||||
| 	if (deleterefs && argc < 2) | 	if (deleterefs && argc < 2) | ||||||
| 		die(_("--delete doesn't make sense without any refs")); | 		die(_("--delete doesn't make sense without any refs")); | ||||||
|  |  | ||||||
|  | @ -627,18 +627,18 @@ int cmd_push(int argc, const char **argv, const char *prefix) | ||||||
|  |  | ||||||
| 	if (flags & TRANSPORT_PUSH_ALL) { | 	if (flags & TRANSPORT_PUSH_ALL) { | ||||||
| 		if (tags) | 		if (tags) | ||||||
| 			die(_("--all and --tags are incompatible")); | 			die(_("options '%s' and '%s' cannot be used together"), "--all", "--tags"); | ||||||
| 		if (argc >= 2) | 		if (argc >= 2) | ||||||
| 			die(_("--all can't be combined with refspecs")); | 			die(_("--all can't be combined with refspecs")); | ||||||
| 	} | 	} | ||||||
| 	if (flags & TRANSPORT_PUSH_MIRROR) { | 	if (flags & TRANSPORT_PUSH_MIRROR) { | ||||||
| 		if (tags) | 		if (tags) | ||||||
| 			die(_("--mirror and --tags are incompatible")); | 			die(_("options '%s' and '%s' cannot be used together"), "--mirror", "--tags"); | ||||||
| 		if (argc >= 2) | 		if (argc >= 2) | ||||||
| 			die(_("--mirror can't be combined with refspecs")); | 			die(_("--mirror can't be combined with refspecs")); | ||||||
| 	} | 	} | ||||||
| 	if ((flags & TRANSPORT_PUSH_ALL) && (flags & TRANSPORT_PUSH_MIRROR)) | 	if ((flags & TRANSPORT_PUSH_ALL) && (flags & TRANSPORT_PUSH_MIRROR)) | ||||||
| 		die(_("--all and --mirror are incompatible")); | 		die(_("options '%s' and '%s' cannot be used together"), "--all", "--mirror"); | ||||||
|  |  | ||||||
| 	if (!is_empty_cas(&cas) && (flags & TRANSPORT_PUSH_FORCE_IF_INCLUDES)) | 	if (!is_empty_cas(&cas) && (flags & TRANSPORT_PUSH_FORCE_IF_INCLUDES)) | ||||||
| 		cas.use_force_if_includes = 1; | 		cas.use_force_if_includes = 1; | ||||||
|  |  | ||||||
|  | @ -1190,13 +1190,13 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) | ||||||
|  |  | ||||||
| 	if (keep_base) { | 	if (keep_base) { | ||||||
| 		if (options.onto_name) | 		if (options.onto_name) | ||||||
| 			die(_("cannot combine '--keep-base' with '--onto'")); | 			die(_("options '%s' and '%s' cannot be used together"), "--keep-base", "--onto"); | ||||||
| 		if (options.root) | 		if (options.root) | ||||||
| 			die(_("cannot combine '--keep-base' with '--root'")); | 			die(_("options '%s' and '%s' cannot be used together"), "--keep-base", "--root"); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if (options.root && options.fork_point > 0) | 	if (options.root && options.fork_point > 0) | ||||||
| 		die(_("cannot combine '--root' with '--fork-point'")); | 		die(_("options '%s' and '%s' cannot be used together"), "--root", "--fork-point"); | ||||||
|  |  | ||||||
| 	if (action != ACTION_NONE && !in_progress) | 	if (action != ACTION_NONE && !in_progress) | ||||||
| 		die(_("No rebase in progress?")); | 		die(_("No rebase in progress?")); | ||||||
|  | @ -1460,8 +1460,8 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) | ||||||
|  |  | ||||||
| 		if (i >= 0) { | 		if (i >= 0) { | ||||||
| 			if (is_merge(&options)) | 			if (is_merge(&options)) | ||||||
| 				die(_("cannot combine apply options with " | 				die(_("apply options and merge options " | ||||||
| 				      "merge options")); | 					  "cannot be used together")); | ||||||
| 			else | 			else | ||||||
| 				options.type = REBASE_APPLY; | 				options.type = REBASE_APPLY; | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | @ -681,7 +681,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix) | ||||||
|  |  | ||||||
| 	if (keep_unreachable && | 	if (keep_unreachable && | ||||||
| 	    (unpack_unreachable || (pack_everything & LOOSEN_UNREACHABLE))) | 	    (unpack_unreachable || (pack_everything & LOOSEN_UNREACHABLE))) | ||||||
| 		die(_("--keep-unreachable and -A are incompatible")); | 		die(_("options '%s' and '%s' cannot be used together"), "--keep-unreachable", "-A"); | ||||||
|  |  | ||||||
| 	if (write_bitmaps < 0) { | 	if (write_bitmaps < 0) { | ||||||
| 		if (!write_midx && | 		if (!write_midx && | ||||||
|  | @ -712,7 +712,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix) | ||||||
|  |  | ||||||
| 	if (geometric_factor) { | 	if (geometric_factor) { | ||||||
| 		if (pack_everything) | 		if (pack_everything) | ||||||
| 			die(_("--geometric is incompatible with -A, -a")); | 			die(_("options '%s' and '%s' cannot be used together"), "--geometric", "-A/-a"); | ||||||
| 		init_pack_geometry(&geometry); | 		init_pack_geometry(&geometry); | ||||||
| 		split_pack_geometry(geometry, geometric_factor); | 		split_pack_geometry(geometry, geometric_factor); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | @ -423,16 +423,16 @@ int cmd_reset(int argc, const char **argv, const char *prefix) | ||||||
|  |  | ||||||
| 	if (pathspec_from_file) { | 	if (pathspec_from_file) { | ||||||
| 		if (patch_mode) | 		if (patch_mode) | ||||||
| 			die(_("--pathspec-from-file is incompatible with --patch")); | 			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--patch"); | ||||||
|  |  | ||||||
| 		if (pathspec.nr) | 		if (pathspec.nr) | ||||||
| 			die(_("--pathspec-from-file is incompatible with pathspec arguments")); | 			die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file"); | ||||||
|  |  | ||||||
| 		parse_pathspec_file(&pathspec, 0, | 		parse_pathspec_file(&pathspec, 0, | ||||||
| 				    PATHSPEC_PREFER_FULL, | 				    PATHSPEC_PREFER_FULL, | ||||||
| 				    prefix, pathspec_from_file, pathspec_file_nul); | 				    prefix, pathspec_from_file, pathspec_file_nul); | ||||||
| 	} else if (pathspec_file_nul) { | 	} else if (pathspec_file_nul) { | ||||||
| 		die(_("--pathspec-file-nul requires --pathspec-from-file")); | 		die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file"); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	unborn = !strcmp(rev, "HEAD") && get_oid("HEAD", &oid); | 	unborn = !strcmp(rev, "HEAD") && get_oid("HEAD", &oid); | ||||||
|  | @ -459,7 +459,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix) | ||||||
|  |  | ||||||
| 	if (patch_mode) { | 	if (patch_mode) { | ||||||
| 		if (reset_type != NONE) | 		if (reset_type != NONE) | ||||||
| 			die(_("--patch is incompatible with --{hard,mixed,soft}")); | 			die(_("options '%s' and '%s' cannot be used together"), "--patch", "--{hard,mixed,soft}"); | ||||||
| 		trace2_cmd_mode("patch-interactive"); | 		trace2_cmd_mode("patch-interactive"); | ||||||
| 		return run_add_interactive(rev, "--patch=reset", &pathspec); | 		return run_add_interactive(rev, "--patch=reset", &pathspec); | ||||||
| 	} | 	} | ||||||
|  | @ -490,7 +490,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix) | ||||||
| 		    _(reset_type_names[reset_type])); | 		    _(reset_type_names[reset_type])); | ||||||
|  |  | ||||||
| 	if (intent_to_add && reset_type != MIXED) | 	if (intent_to_add && reset_type != MIXED) | ||||||
| 		die(_("-N can only be used with --mixed")); | 		die(_("the option '%s' requires '%s'"), "-N", "--mixed"); | ||||||
|  |  | ||||||
| 	prepare_repo_settings(the_repository); | 	prepare_repo_settings(the_repository); | ||||||
| 	the_repository->settings.command_requires_full_index = 0; | 	the_repository->settings.command_requires_full_index = 0; | ||||||
|  |  | ||||||
|  | @ -538,7 +538,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) | ||||||
| 		const char *arg = argv[i]; | 		const char *arg = argv[i]; | ||||||
| 		if (skip_prefix(arg, "--missing=", &arg)) { | 		if (skip_prefix(arg, "--missing=", &arg)) { | ||||||
| 			if (revs.exclude_promisor_objects) | 			if (revs.exclude_promisor_objects) | ||||||
| 				die(_("cannot combine --exclude-promisor-objects and --missing")); | 				die(_("options '%s' and '%s' cannot be used together"), "--exclude-promisor-objects", "--missing"); | ||||||
| 			if (parse_missing_action_value(arg)) | 			if (parse_missing_action_value(arg)) | ||||||
| 				break; | 				break; | ||||||
| 		} | 		} | ||||||
|  | @ -676,7 +676,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) | ||||||
| 	if (revs.count && | 	if (revs.count && | ||||||
| 	    (revs.tag_objects || revs.tree_objects || revs.blob_objects) && | 	    (revs.tag_objects || revs.tree_objects || revs.blob_objects) && | ||||||
| 	    (revs.left_right || revs.cherry_mark)) | 	    (revs.left_right || revs.cherry_mark)) | ||||||
| 		die(_("marked counting is incompatible with --objects")); | 		die(_("marked counting and '%s' cannot be used together"), "--objects"); | ||||||
|  |  | ||||||
| 	save_commit_buffer = (revs.verbose_header || | 	save_commit_buffer = (revs.verbose_header || | ||||||
| 			      revs.grep_filter.pattern_list || | 			      revs.grep_filter.pattern_list || | ||||||
|  |  | ||||||
|  | @ -272,13 +272,13 @@ int cmd_rm(int argc, const char **argv, const char *prefix) | ||||||
|  |  | ||||||
| 	if (pathspec_from_file) { | 	if (pathspec_from_file) { | ||||||
| 		if (pathspec.nr) | 		if (pathspec.nr) | ||||||
| 			die(_("--pathspec-from-file is incompatible with pathspec arguments")); | 			die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file"); | ||||||
|  |  | ||||||
| 		parse_pathspec_file(&pathspec, 0, | 		parse_pathspec_file(&pathspec, 0, | ||||||
| 				    PATHSPEC_PREFER_CWD, | 				    PATHSPEC_PREFER_CWD, | ||||||
| 				    prefix, pathspec_from_file, pathspec_file_nul); | 				    prefix, pathspec_from_file, pathspec_file_nul); | ||||||
| 	} else if (pathspec_file_nul) { | 	} else if (pathspec_file_nul) { | ||||||
| 		die(_("--pathspec-file-nul requires --pathspec-from-file")); | 		die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file"); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if (!pathspec.nr) | 	if (!pathspec.nr) | ||||||
|  |  | ||||||
|  | @ -707,8 +707,8 @@ int cmd_show_branch(int ac, const char **av, const char *prefix) | ||||||
| 			 * | 			 * | ||||||
| 			 * Also --all and --remotes do not make sense either. | 			 * Also --all and --remotes do not make sense either. | ||||||
| 			 */ | 			 */ | ||||||
| 			die(_("--reflog is incompatible with --all, --remotes, " | 			die(_("options '%s' and '%s' cannot be used together"), "--reflog", | ||||||
| 			      "--independent or --merge-base")); | 				"--all/--remotes/--independent/--merge-base"); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	/* If nothing is specified, show all branches by default */ | 	/* If nothing is specified, show all branches by default */ | ||||||
|  |  | ||||||
|  | @ -1703,19 +1703,19 @@ static int push_stash(int argc, const char **argv, const char *prefix, | ||||||
|  |  | ||||||
| 	if (pathspec_from_file) { | 	if (pathspec_from_file) { | ||||||
| 		if (patch_mode) | 		if (patch_mode) | ||||||
| 			die(_("--pathspec-from-file is incompatible with --patch")); | 			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--patch"); | ||||||
|  |  | ||||||
| 		if (only_staged) | 		if (only_staged) | ||||||
| 			die(_("--pathspec-from-file is incompatible with --staged")); | 			die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--staged"); | ||||||
|  |  | ||||||
| 		if (ps.nr) | 		if (ps.nr) | ||||||
| 			die(_("--pathspec-from-file is incompatible with pathspec arguments")); | 			die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file"); | ||||||
|  |  | ||||||
| 		parse_pathspec_file(&ps, 0, | 		parse_pathspec_file(&ps, 0, | ||||||
| 				    PATHSPEC_PREFER_FULL | PATHSPEC_PREFIX_ORIGIN, | 				    PATHSPEC_PREFER_FULL | PATHSPEC_PREFIX_ORIGIN, | ||||||
| 				    prefix, pathspec_from_file, pathspec_file_nul); | 				    prefix, pathspec_from_file, pathspec_file_nul); | ||||||
| 	} else if (pathspec_file_nul) { | 	} else if (pathspec_file_nul) { | ||||||
| 		die(_("--pathspec-file-nul requires --pathspec-from-file")); | 		die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file"); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	return do_push_stash(&ps, stash_msg, quiet, keep_index, patch_mode, | 	return do_push_stash(&ps, stash_msg, quiet, keep_index, patch_mode, | ||||||
|  |  | ||||||
|  | @ -1313,7 +1313,7 @@ static int module_summary(int argc, const char **argv, const char *prefix) | ||||||
|  |  | ||||||
| 	if (files) { | 	if (files) { | ||||||
| 		if (cached) | 		if (cached) | ||||||
| 			die(_("--cached and --files are mutually exclusive")); | 			die(_("options '%s' and '%s' cannot be used together"), "--cached", "--files"); | ||||||
| 		diff_cmd = DIFF_FILES; | 		diff_cmd = DIFF_FILES; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | @ -2972,7 +2972,7 @@ static int module_set_branch(int argc, const char **argv, const char *prefix) | ||||||
| 		die(_("--branch or --default required")); | 		die(_("--branch or --default required")); | ||||||
|  |  | ||||||
| 	if (opt_branch && opt_default) | 	if (opt_branch && opt_default) | ||||||
| 		die(_("--branch and --default are mutually exclusive")); | 		die(_("options '%s' and '%s' cannot be used together"), "--branch", "--default"); | ||||||
|  |  | ||||||
| 	if (argc != 1 || !(path = argv[0])) | 	if (argc != 1 || !(path = argv[0])) | ||||||
| 		usage_with_options(usage, options); | 		usage_with_options(usage, options); | ||||||
|  |  | ||||||
|  | @ -483,6 +483,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix) | ||||||
| 		OPT_END() | 		OPT_END() | ||||||
| 	}; | 	}; | ||||||
| 	int ret = 0; | 	int ret = 0; | ||||||
|  | 	const char *only_in_list = NULL; | ||||||
|  |  | ||||||
| 	setup_ref_filter_porcelain_msg(); | 	setup_ref_filter_porcelain_msg(); | ||||||
|  |  | ||||||
|  | @ -522,7 +523,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix) | ||||||
| 	finalize_colopts(&colopts, -1); | 	finalize_colopts(&colopts, -1); | ||||||
| 	if (cmdmode == 'l' && filter.lines != -1) { | 	if (cmdmode == 'l' && filter.lines != -1) { | ||||||
| 		if (explicitly_enable_column(colopts)) | 		if (explicitly_enable_column(colopts)) | ||||||
| 			die(_("--column and -n are incompatible")); | 			die(_("options '%s' and '%s' cannot be used together"), "--column", "-n"); | ||||||
| 		colopts = 0; | 		colopts = 0; | ||||||
| 	} | 	} | ||||||
| 	sorting = ref_sorting_options(&sorting_options); | 	sorting = ref_sorting_options(&sorting_options); | ||||||
|  | @ -542,15 +543,19 @@ int cmd_tag(int argc, const char **argv, const char *prefix) | ||||||
| 		goto cleanup; | 		goto cleanup; | ||||||
| 	} | 	} | ||||||
| 	if (filter.lines != -1) | 	if (filter.lines != -1) | ||||||
| 		die(_("-n option is only allowed in list mode")); | 		only_in_list = "-n"; | ||||||
| 	if (filter.with_commit) | 	else if (filter.with_commit) | ||||||
| 		die(_("--contains option is only allowed in list mode")); | 		only_in_list = "--contains"; | ||||||
| 	if (filter.no_commit) | 	else if (filter.no_commit) | ||||||
| 		die(_("--no-contains option is only allowed in list mode")); | 		only_in_list = "--no-contains"; | ||||||
| 	if (filter.points_at.nr) | 	else if (filter.points_at.nr) | ||||||
| 		die(_("--points-at option is only allowed in list mode")); | 		only_in_list = "--points-at"; | ||||||
| 	if (filter.reachable_from || filter.unreachable_from) | 	else if (filter.reachable_from) | ||||||
| 		die(_("--merged and --no-merged options are only allowed in list mode")); | 		only_in_list = "--merged"; | ||||||
|  | 	else if (filter.unreachable_from) | ||||||
|  | 		only_in_list = "--no-merged"; | ||||||
|  | 	if (only_in_list) | ||||||
|  | 		die(_("the '%s' option is only allowed in list mode"), only_in_list); | ||||||
| 	if (cmdmode == 'd') { | 	if (cmdmode == 'd') { | ||||||
| 		ret = delete_tags(argv); | 		ret = delete_tags(argv); | ||||||
| 		goto cleanup; | 		goto cleanup; | ||||||
|  | @ -564,7 +569,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix) | ||||||
|  |  | ||||||
| 	if (msg.given || msgfile) { | 	if (msg.given || msgfile) { | ||||||
| 		if (msg.given && msgfile) | 		if (msg.given && msgfile) | ||||||
| 			die(_("only one -F or -m option is allowed.")); | 			die(_("options '%s' and '%s' cannot be used together"), "-F", "-m"); | ||||||
| 		if (msg.given) | 		if (msg.given) | ||||||
| 			strbuf_addbuf(&buf, &(msg.buf)); | 			strbuf_addbuf(&buf, &(msg.buf)); | ||||||
| 		else { | 		else { | ||||||
|  |  | ||||||
|  | @ -503,9 +503,9 @@ static int add(int ac, const char **av, const char *prefix) | ||||||
| 	opts.checkout = 1; | 	opts.checkout = 1; | ||||||
| 	ac = parse_options(ac, av, prefix, options, worktree_usage, 0); | 	ac = parse_options(ac, av, prefix, options, worktree_usage, 0); | ||||||
| 	if (!!opts.detach + !!new_branch + !!new_branch_force > 1) | 	if (!!opts.detach + !!new_branch + !!new_branch_force > 1) | ||||||
| 		die(_("-b, -B, and --detach are mutually exclusive")); | 		die(_("options '%s', '%s', and '%s' cannot be used together"), "-b", "-B", "--detach"); | ||||||
| 	if (lock_reason && !keep_locked) | 	if (lock_reason && !keep_locked) | ||||||
| 		die(_("--reason requires --lock")); | 		die(_("the option '%s' requires '%s'"), "--reason", "--lock"); | ||||||
| 	if (lock_reason) | 	if (lock_reason) | ||||||
| 		opts.keep_locked = lock_reason; | 		opts.keep_locked = lock_reason; | ||||||
| 	else if (keep_locked) | 	else if (keep_locked) | ||||||
|  | @ -699,7 +699,7 @@ static int list(int ac, const char **av, const char *prefix) | ||||||
| 	if (ac) | 	if (ac) | ||||||
| 		usage_with_options(worktree_usage, options); | 		usage_with_options(worktree_usage, options); | ||||||
| 	else if (verbose && porcelain) | 	else if (verbose && porcelain) | ||||||
| 		die(_("--verbose and --porcelain are mutually exclusive")); | 		die(_("options '%s' and '%s' cannot be used together"), "--verbose", "--porcelain"); | ||||||
| 	else { | 	else { | ||||||
| 		struct worktree **worktrees = get_worktrees(); | 		struct worktree **worktrees = get_worktrees(); | ||||||
| 		int path_maxlen = 0, abbrev = DEFAULT_ABBREV, i; | 		int path_maxlen = 0, abbrev = DEFAULT_ABBREV, i; | ||||||
|  |  | ||||||
							
								
								
									
										12
									
								
								diff.c
								
								
								
								
							
							
						
						
									
										12
									
								
								diff.c
								
								
								
								
							|  | @ -4586,16 +4586,20 @@ void diff_setup_done(struct diff_options *options) | ||||||
| 		options->set_default(options); | 		options->set_default(options); | ||||||
|  |  | ||||||
| 	if (HAS_MULTI_BITS(options->output_format & check_mask)) | 	if (HAS_MULTI_BITS(options->output_format & check_mask)) | ||||||
| 		die(_("--name-only, --name-status, --check and -s are mutually exclusive")); | 		die(_("options '%s', '%s', '%s', and '%s' cannot be used together"), | ||||||
|  | 			"--name-only", "--name-status", "--check", "-s"); | ||||||
|  |  | ||||||
| 	if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_MASK)) | 	if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_MASK)) | ||||||
| 		die(_("-G, -S and --find-object are mutually exclusive")); | 		die(_("options '%s', '%s', and '%s' cannot be used together"), | ||||||
|  | 			"-G", "-S", "--find-object"); | ||||||
|  |  | ||||||
| 	if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_G_REGEX_MASK)) | 	if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_G_REGEX_MASK)) | ||||||
| 		die(_("-G and --pickaxe-regex are mutually exclusive, use --pickaxe-regex with -S")); | 		die(_("options '%s' and '%s' cannot be used together, use '%s' with '%s'"), | ||||||
|  | 			"-G", "--pickaxe-regex", "--pickaxe-regex", "-S"); | ||||||
|  |  | ||||||
| 	if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_ALL_OBJFIND_MASK)) | 	if (HAS_MULTI_BITS(options->pickaxe_opts & DIFF_PICKAXE_KINDS_ALL_OBJFIND_MASK)) | ||||||
| 		die(_("--pickaxe-all and --find-object are mutually exclusive, use --pickaxe-all with -G and -S")); | 		die(_("options '%s' and '%s' cannot be used together, use '%s' with '%s' and '%s'"), | ||||||
|  | 			"--pickaxe-all", "--find-object", "--pickaxe-all", "-G", "-S"); | ||||||
|  |  | ||||||
| 	/* | 	/* | ||||||
| 	 * Most of the time we can say "there are changes" | 	 * Most of the time we can say "there are changes" | ||||||
|  |  | ||||||
|  | @ -297,7 +297,7 @@ static int find_common(struct fetch_negotiator *negotiator, | ||||||
| 	struct packet_reader reader; | 	struct packet_reader reader; | ||||||
|  |  | ||||||
| 	if (args->stateless_rpc && multi_ack == 1) | 	if (args->stateless_rpc && multi_ack == 1) | ||||||
| 		die(_("--stateless-rpc requires multi_ack_detailed")); | 		die(_("the option '%s' requires '%s'"), "--stateless-rpc", "multi_ack_detailed"); | ||||||
|  |  | ||||||
| 	packet_reader_init(&reader, fd[0], NULL, 0, | 	packet_reader_init(&reader, fd[0], NULL, 0, | ||||||
| 			   PACKET_READ_CHOMP_NEWLINE | | 			   PACKET_READ_CHOMP_NEWLINE | | ||||||
|  |  | ||||||
							
								
								
									
										6
									
								
								git.c
								
								
								
								
							
							
						
						
									
										6
									
								
								git.c
								
								
								
								
							|  | @ -185,7 +185,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged) | ||||||
| 				*envchanged = 1; | 				*envchanged = 1; | ||||||
| 		} else if (!strcmp(cmd, "--git-dir")) { | 		} else if (!strcmp(cmd, "--git-dir")) { | ||||||
| 			if (*argc < 2) { | 			if (*argc < 2) { | ||||||
| 				fprintf(stderr, _("no directory given for --git-dir\n" )); | 				fprintf(stderr, _("no directory given for '%s' option\n" ), "--git-dir"); | ||||||
| 				usage(git_usage_string); | 				usage(git_usage_string); | ||||||
| 			} | 			} | ||||||
| 			setenv(GIT_DIR_ENVIRONMENT, (*argv)[1], 1); | 			setenv(GIT_DIR_ENVIRONMENT, (*argv)[1], 1); | ||||||
|  | @ -213,7 +213,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged) | ||||||
| 				*envchanged = 1; | 				*envchanged = 1; | ||||||
| 		} else if (!strcmp(cmd, "--work-tree")) { | 		} else if (!strcmp(cmd, "--work-tree")) { | ||||||
| 			if (*argc < 2) { | 			if (*argc < 2) { | ||||||
| 				fprintf(stderr, _("no directory given for --work-tree\n" )); | 				fprintf(stderr, _("no directory given for '%s' option\n" ), "--work-tree"); | ||||||
| 				usage(git_usage_string); | 				usage(git_usage_string); | ||||||
| 			} | 			} | ||||||
| 			setenv(GIT_WORK_TREE_ENVIRONMENT, (*argv)[1], 1); | 			setenv(GIT_WORK_TREE_ENVIRONMENT, (*argv)[1], 1); | ||||||
|  | @ -297,7 +297,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged) | ||||||
| 				*envchanged = 1; | 				*envchanged = 1; | ||||||
| 		} else if (!strcmp(cmd, "-C")) { | 		} else if (!strcmp(cmd, "-C")) { | ||||||
| 			if (*argc < 2) { | 			if (*argc < 2) { | ||||||
| 				fprintf(stderr, _("no directory given for -C\n" )); | 				fprintf(stderr, _("no directory given for '%s' option\n" ), "-C"); | ||||||
| 				usage(git_usage_string); | 				usage(git_usage_string); | ||||||
| 			} | 			} | ||||||
| 			if ((*argv)[1][0]) { | 			if ((*argv)[1][0]) { | ||||||
|  |  | ||||||
|  | @ -141,7 +141,7 @@ int cmd_main(int argc, const char **argv) | ||||||
|  |  | ||||||
| 	if (packfile) { | 	if (packfile) { | ||||||
| 		if (!index_pack_args.nr) | 		if (!index_pack_args.nr) | ||||||
| 			die(_("--packfile requires --index-pack-args")); | 			die(_("the option '%s' requires '%s'"), "--packfile", "--index-pack-args"); | ||||||
|  |  | ||||||
| 		fetch_single_packfile(&packfile_hash, argv[arg], | 		fetch_single_packfile(&packfile_hash, argv[arg], | ||||||
| 				      index_pack_args.v); | 				      index_pack_args.v); | ||||||
|  | @ -150,7 +150,7 @@ int cmd_main(int argc, const char **argv) | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if (index_pack_args.nr) | 	if (index_pack_args.nr) | ||||||
| 		die(_("--index-pack-args can only be used with --packfile")); | 		die(_("the option '%s' requires '%s'"), "--index-pack-args", "--packfile"); | ||||||
|  |  | ||||||
| 	if (commits_on_stdin) { | 	if (commits_on_stdin) { | ||||||
| 		commits = walker_targets_stdin(&commit_id, &write_ref); | 		commits = walker_targets_stdin(&commit_id, &write_ref); | ||||||
|  |  | ||||||
|  | @ -556,7 +556,7 @@ int show_range_diff(const char *range1, const char *range2, | ||||||
| 	struct string_list branch2 = STRING_LIST_INIT_DUP; | 	struct string_list branch2 = STRING_LIST_INIT_DUP; | ||||||
|  |  | ||||||
| 	if (range_diff_opts->left_only && range_diff_opts->right_only) | 	if (range_diff_opts->left_only && range_diff_opts->right_only) | ||||||
| 		res = error(_("--left-only and --right-only are mutually exclusive")); | 		res = error(_("options '%s' and '%s' cannot be used together"), "--left-only", "--right-only"); | ||||||
|  |  | ||||||
| 	if (!res && read_patches(range1, &branch1, range_diff_opts->other_arg)) | 	if (!res && read_patches(range1, &branch1, range_diff_opts->other_arg)) | ||||||
| 		res = error(_("could not parse log for '%s'"), range1); | 		res = error(_("could not parse log for '%s'"), range1); | ||||||
|  |  | ||||||
							
								
								
									
										22
									
								
								ref-filter.c
								
								
								
								
							
							
						
						
									
										22
									
								
								ref-filter.c
								
								
								
								
							|  | @ -341,7 +341,7 @@ static int objectsize_atom_parser(struct ref_format *format, struct used_atom *a | ||||||
| 		else | 		else | ||||||
| 			oi.info.disk_sizep = &oi.disk_size; | 			oi.info.disk_sizep = &oi.disk_size; | ||||||
| 	} else | 	} else | ||||||
| 		return strbuf_addf_ret(err, -1, _("unrecognized %%(objectsize) argument: %s"), arg); | 		return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), "objectsize", arg); | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -374,7 +374,7 @@ static int subject_atom_parser(struct ref_format *format, struct used_atom *atom | ||||||
| 	else if (!strcmp(arg, "sanitize")) | 	else if (!strcmp(arg, "sanitize")) | ||||||
| 		atom->u.contents.option = C_SUB_SANITIZE; | 		atom->u.contents.option = C_SUB_SANITIZE; | ||||||
| 	else | 	else | ||||||
| 		return strbuf_addf_ret(err, -1, _("unrecognized %%(subject) argument: %s"), arg); | 		return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), "subject", arg); | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -428,7 +428,7 @@ static int contents_atom_parser(struct ref_format *format, struct used_atom *ato | ||||||
| 		if (strtoul_ui(arg, 10, &atom->u.contents.nlines)) | 		if (strtoul_ui(arg, 10, &atom->u.contents.nlines)) | ||||||
| 			return strbuf_addf_ret(err, -1, _("positive value expected contents:lines=%s"), arg); | 			return strbuf_addf_ret(err, -1, _("positive value expected contents:lines=%s"), arg); | ||||||
| 	} else | 	} else | ||||||
| 		return strbuf_addf_ret(err, -1, _("unrecognized %%(contents) argument: %s"), arg); | 		return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), "contents", arg); | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -440,7 +440,7 @@ static int raw_atom_parser(struct ref_format *format, struct used_atom *atom, | ||||||
| 	else if (!strcmp(arg, "size")) | 	else if (!strcmp(arg, "size")) | ||||||
| 		atom->u.raw_data.option = RAW_LENGTH; | 		atom->u.raw_data.option = RAW_LENGTH; | ||||||
| 	else | 	else | ||||||
| 		return strbuf_addf_ret(err, -1, _("unrecognized %%(raw) argument: %s"), arg); | 		return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), "raw", arg); | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -459,7 +459,7 @@ static int oid_atom_parser(struct ref_format *format, struct used_atom *atom, | ||||||
| 		if (atom->u.oid.length < MINIMUM_ABBREV) | 		if (atom->u.oid.length < MINIMUM_ABBREV) | ||||||
| 			atom->u.oid.length = MINIMUM_ABBREV; | 			atom->u.oid.length = MINIMUM_ABBREV; | ||||||
| 	} else | 	} else | ||||||
| 		return strbuf_addf_ret(err, -1, _("unrecognized argument '%s' in %%(%s)"), arg, atom->name); | 		return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), atom->name, arg); | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -531,7 +531,7 @@ static int align_atom_parser(struct ref_format *format, struct used_atom *atom, | ||||||
| 		else if ((position = parse_align_position(s)) >= 0) | 		else if ((position = parse_align_position(s)) >= 0) | ||||||
| 			align->position = position; | 			align->position = position; | ||||||
| 		else { | 		else { | ||||||
| 			strbuf_addf(err, _("unrecognized %%(align) argument: %s"), s); | 			strbuf_addf(err, _("unrecognized %%(%s) argument: %s"), "align", s); | ||||||
| 			string_list_clear(¶ms, 0); | 			string_list_clear(¶ms, 0); | ||||||
| 			return -1; | 			return -1; | ||||||
| 		} | 		} | ||||||
|  | @ -557,7 +557,7 @@ static int if_atom_parser(struct ref_format *format, struct used_atom *atom, | ||||||
| 	} else if (skip_prefix(arg, "notequals=", &atom->u.if_then_else.str)) { | 	} else if (skip_prefix(arg, "notequals=", &atom->u.if_then_else.str)) { | ||||||
| 		atom->u.if_then_else.cmp_status = COMPARE_UNEQUAL; | 		atom->u.if_then_else.cmp_status = COMPARE_UNEQUAL; | ||||||
| 	} else | 	} else | ||||||
| 		return strbuf_addf_ret(err, -1, _("unrecognized %%(if) argument: %s"), arg); | 		return strbuf_addf_ret(err, -1, _("unrecognized %%(%s) argument: %s"), "if", arg); | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -841,7 +841,7 @@ static void if_then_else_handler(struct ref_formatting_stack **stack) | ||||||
| 	struct if_then_else *if_then_else = (struct if_then_else *)cur->at_end_data; | 	struct if_then_else *if_then_else = (struct if_then_else *)cur->at_end_data; | ||||||
|  |  | ||||||
| 	if (!if_then_else->then_atom_seen) | 	if (!if_then_else->then_atom_seen) | ||||||
| 		die(_("format: %%(if) atom used without a %%(then) atom")); | 		die(_("format: %%(%s) atom used without a %%(%s) atom"), "if", "then"); | ||||||
|  |  | ||||||
| 	if (if_then_else->else_atom_seen) { | 	if (if_then_else->else_atom_seen) { | ||||||
| 		/* | 		/* | ||||||
|  | @ -907,7 +907,7 @@ static int then_atom_handler(struct atom_value *atomv, struct ref_formatting_sta | ||||||
| 	if (cur->at_end == if_then_else_handler) | 	if (cur->at_end == if_then_else_handler) | ||||||
| 		if_then_else = (struct if_then_else *)cur->at_end_data; | 		if_then_else = (struct if_then_else *)cur->at_end_data; | ||||||
| 	if (!if_then_else) | 	if (!if_then_else) | ||||||
| 		return strbuf_addf_ret(err, -1, _("format: %%(then) atom used without an %%(if) atom")); | 		return strbuf_addf_ret(err, -1, _("format: %%(%s) atom used without a %%(%s) atom"), "then", "if"); | ||||||
| 	if (if_then_else->then_atom_seen) | 	if (if_then_else->then_atom_seen) | ||||||
| 		return strbuf_addf_ret(err, -1, _("format: %%(then) atom used more than once")); | 		return strbuf_addf_ret(err, -1, _("format: %%(then) atom used more than once")); | ||||||
| 	if (if_then_else->else_atom_seen) | 	if (if_then_else->else_atom_seen) | ||||||
|  | @ -943,9 +943,9 @@ static int else_atom_handler(struct atom_value *atomv, struct ref_formatting_sta | ||||||
| 	if (prev->at_end == if_then_else_handler) | 	if (prev->at_end == if_then_else_handler) | ||||||
| 		if_then_else = (struct if_then_else *)prev->at_end_data; | 		if_then_else = (struct if_then_else *)prev->at_end_data; | ||||||
| 	if (!if_then_else) | 	if (!if_then_else) | ||||||
| 		return strbuf_addf_ret(err, -1, _("format: %%(else) atom used without an %%(if) atom")); | 		return strbuf_addf_ret(err, -1, _("format: %%(%s) atom used without a %%(%s) atom"), "else", "if"); | ||||||
| 	if (!if_then_else->then_atom_seen) | 	if (!if_then_else->then_atom_seen) | ||||||
| 		return strbuf_addf_ret(err, -1, _("format: %%(else) atom used without a %%(then) atom")); | 		return strbuf_addf_ret(err, -1, _("format: %%(%s) atom used without a %%(%s) atom"), "else", "then"); | ||||||
| 	if (if_then_else->else_atom_seen) | 	if (if_then_else->else_atom_seen) | ||||||
| 		return strbuf_addf_ret(err, -1, _("format: %%(else) atom used more than once")); | 		return strbuf_addf_ret(err, -1, _("format: %%(else) atom used more than once")); | ||||||
| 	if_then_else->else_atom_seen = 1; | 	if_then_else->else_atom_seen = 1; | ||||||
|  |  | ||||||
							
								
								
									
										22
									
								
								revision.c
								
								
								
								
							
							
						
						
									
										22
									
								
								revision.c
								
								
								
								
							|  | @ -2300,11 +2300,11 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg | ||||||
| 		revs->left_only = 1; | 		revs->left_only = 1; | ||||||
| 	} else if (!strcmp(arg, "--right-only")) { | 	} else if (!strcmp(arg, "--right-only")) { | ||||||
| 		if (revs->left_only) | 		if (revs->left_only) | ||||||
| 			die("--right-only is incompatible with --left-only"); | 			die(_("options '%s' and '%s' cannot be used together"), "--right-only", "--left-only"); | ||||||
| 		revs->right_only = 1; | 		revs->right_only = 1; | ||||||
| 	} else if (!strcmp(arg, "--cherry")) { | 	} else if (!strcmp(arg, "--cherry")) { | ||||||
| 		if (revs->left_only) | 		if (revs->left_only) | ||||||
| 			die("--cherry is incompatible with --left-only"); | 			die(_("options '%s' and '%s' cannot be used together"), "--cherry", "--left-only"); | ||||||
| 		revs->cherry_mark = 1; | 		revs->cherry_mark = 1; | ||||||
| 		revs->right_only = 1; | 		revs->right_only = 1; | ||||||
| 		revs->max_parents = 1; | 		revs->max_parents = 1; | ||||||
|  | @ -2313,12 +2313,12 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg | ||||||
| 		revs->count = 1; | 		revs->count = 1; | ||||||
| 	} else if (!strcmp(arg, "--cherry-mark")) { | 	} else if (!strcmp(arg, "--cherry-mark")) { | ||||||
| 		if (revs->cherry_pick) | 		if (revs->cherry_pick) | ||||||
| 			die("--cherry-mark is incompatible with --cherry-pick"); | 			die(_("options '%s' and '%s' cannot be used together"), "--cherry-mark", "--cherry-pick"); | ||||||
| 		revs->cherry_mark = 1; | 		revs->cherry_mark = 1; | ||||||
| 		revs->limited = 1; /* needs limit_list() */ | 		revs->limited = 1; /* needs limit_list() */ | ||||||
| 	} else if (!strcmp(arg, "--cherry-pick")) { | 	} else if (!strcmp(arg, "--cherry-pick")) { | ||||||
| 		if (revs->cherry_mark) | 		if (revs->cherry_mark) | ||||||
| 			die("--cherry-pick is incompatible with --cherry-mark"); | 			die(_("options '%s' and '%s' cannot be used together"), "--cherry-pick", "--cherry-mark"); | ||||||
| 		revs->cherry_pick = 1; | 		revs->cherry_pick = 1; | ||||||
| 		revs->limited = 1; | 		revs->limited = 1; | ||||||
| 	} else if (!strcmp(arg, "--objects")) { | 	} else if (!strcmp(arg, "--objects")) { | ||||||
|  | @ -2524,7 +2524,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg | ||||||
| 		return opts; | 		return opts; | ||||||
| 	} | 	} | ||||||
| 	if (revs->graph && revs->track_linear) | 	if (revs->graph && revs->track_linear) | ||||||
| 		die("--show-linear-break and --graph are incompatible"); | 		die(_("options '%s' and '%s' cannot be used together"), "--show-linear-break", "--graph"); | ||||||
|  |  | ||||||
| 	return 1; | 	return 1; | ||||||
| } | } | ||||||
|  | @ -2867,24 +2867,24 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s | ||||||
| 	compile_grep_patterns(&revs->grep_filter); | 	compile_grep_patterns(&revs->grep_filter); | ||||||
|  |  | ||||||
| 	if (revs->reverse && revs->reflog_info) | 	if (revs->reverse && revs->reflog_info) | ||||||
| 		die("cannot combine --reverse with --walk-reflogs"); | 		die(_("options '%s' and '%s' cannot be used together"), "--reverse", "--walk-reflogs"); | ||||||
| 	if (revs->reflog_info && revs->limited) | 	if (revs->reflog_info && revs->limited) | ||||||
| 		die("cannot combine --walk-reflogs with history-limiting options"); | 		die("cannot combine --walk-reflogs with history-limiting options"); | ||||||
| 	if (revs->rewrite_parents && revs->children.name) | 	if (revs->rewrite_parents && revs->children.name) | ||||||
| 		die("cannot combine --parents and --children"); | 		die(_("options '%s' and '%s' cannot be used together"), "--parents", "--children"); | ||||||
|  |  | ||||||
| 	/* | 	/* | ||||||
| 	 * Limitations on the graph functionality | 	 * Limitations on the graph functionality | ||||||
| 	 */ | 	 */ | ||||||
| 	if (revs->reverse && revs->graph) | 	if (revs->reverse && revs->graph) | ||||||
| 		die("cannot combine --reverse with --graph"); | 		die(_("options '%s' and '%s' cannot be used together"), "--reverse", "--graph"); | ||||||
|  |  | ||||||
| 	if (revs->reflog_info && revs->graph) | 	if (revs->reflog_info && revs->graph) | ||||||
| 		die("cannot combine --walk-reflogs with --graph"); | 		die(_("options '%s' and '%s' cannot be used together"), "--walk-reflogs", "--graph"); | ||||||
| 	if (revs->no_walk && revs->graph) | 	if (revs->no_walk && revs->graph) | ||||||
| 		die("cannot combine --no-walk with --graph"); | 		die(_("options '%s' and '%s' cannot be used together"), "--no-walk", "--graph"); | ||||||
| 	if (!revs->reflog_info && revs->grep_filter.use_reflog_filter) | 	if (!revs->reflog_info && revs->grep_filter.use_reflog_filter) | ||||||
| 		die("cannot use --grep-reflog without --walk-reflogs"); | 		die(_("the option '%s' requires '%s'"), "--grep-reflog", "--walk-reflogs"); | ||||||
|  |  | ||||||
| 	if (revs->line_level_traverse && | 	if (revs->line_level_traverse && | ||||||
| 	    (revs->diffopt.output_format & ~(DIFF_FORMAT_PATCH | DIFF_FORMAT_NO_OUTPUT))) | 	    (revs->diffopt.output_format & ~(DIFF_FORMAT_PATCH | DIFF_FORMAT_NO_OUTPUT))) | ||||||
|  |  | ||||||
|  | @ -331,7 +331,7 @@ test_expect_success 'init with separate gitdir' ' | ||||||
|  |  | ||||||
| test_expect_success 'explicit bare & --separate-git-dir incompatible' ' | test_expect_success 'explicit bare & --separate-git-dir incompatible' ' | ||||||
| 	test_must_fail git init --bare --separate-git-dir goop.git bare.git 2>err && | 	test_must_fail git init --bare --separate-git-dir goop.git bare.git 2>err && | ||||||
| 	test_i18ngrep "mutually exclusive" err | 	test_i18ngrep "cannot be used together" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'implicit bare & --separate-git-dir incompatible' ' | test_expect_success 'implicit bare & --separate-git-dir incompatible' ' | ||||||
|  |  | ||||||
|  | @ -25,7 +25,7 @@ test_expect_success 'checkout --no-overlay removing last file from directory' ' | ||||||
|  |  | ||||||
| test_expect_success 'checkout -p --overlay is disallowed' ' | test_expect_success 'checkout -p --overlay is disallowed' ' | ||||||
| 	test_must_fail git checkout -p --overlay HEAD 2>actual && | 	test_must_fail git checkout -p --overlay HEAD 2>actual && | ||||||
| 	test_i18ngrep "fatal: -p and --overlay are mutually exclusive" actual | 	test_i18ngrep "fatal: options .-p. and .--overlay. cannot be used together" actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success '--no-overlay --theirs with D/F conflict deletes file' ' | test_expect_success '--no-overlay --theirs with D/F conflict deletes file' ' | ||||||
|  |  | ||||||
|  | @ -149,16 +149,16 @@ test_expect_success 'error conditions' ' | ||||||
| 	echo fileA.t >list && | 	echo fileA.t >list && | ||||||
|  |  | ||||||
| 	test_must_fail git checkout --pathspec-from-file=list --detach 2>err && | 	test_must_fail git checkout --pathspec-from-file=list --detach 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-from-file is incompatible with --detach" err && | 	test_i18ngrep -e "options .--pathspec-from-file. and .--detach. cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git checkout --pathspec-from-file=list --patch 2>err && | 	test_must_fail git checkout --pathspec-from-file=list --patch 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-from-file is incompatible with --patch" err && | 	test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git checkout --pathspec-from-file=list -- fileA.t 2>err && | 	test_must_fail git checkout --pathspec-from-file=list -- fileA.t 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && | 	test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git checkout --pathspec-file-nul 2>err && | 	test_must_fail git checkout --pathspec-file-nul 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err | 	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  |  | ||||||
|  | @ -152,13 +152,13 @@ test_expect_success 'error conditions' ' | ||||||
| 	>empty_list && | 	>empty_list && | ||||||
|  |  | ||||||
| 	test_must_fail git restore --pathspec-from-file=list --patch --source=HEAD^1 2>err && | 	test_must_fail git restore --pathspec-from-file=list --patch --source=HEAD^1 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-from-file is incompatible with --patch" err && | 	test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git restore --pathspec-from-file=list --source=HEAD^1 -- fileA.t 2>err && | 	test_must_fail git restore --pathspec-from-file=list --source=HEAD^1 -- fileA.t 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && | 	test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git restore --pathspec-file-nul --source=HEAD^1 2>err && | 	test_must_fail git restore --pathspec-file-nul --source=HEAD^1 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err && | 	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && | ||||||
|  |  | ||||||
| 	test_must_fail git restore --pathspec-from-file=empty_list --source=HEAD^1 2>err && | 	test_must_fail git restore --pathspec-from-file=empty_list --source=HEAD^1 2>err && | ||||||
| 	test_i18ngrep -e "you must specify path(s) to restore" err | 	test_i18ngrep -e "you must specify path(s) to restore" err | ||||||
|  |  | ||||||
|  | @ -83,7 +83,7 @@ test_expect_success 'git rebase --fork-point with ambigous refname' ' | ||||||
|  |  | ||||||
| test_expect_success '--fork-point and --root both given' ' | test_expect_success '--fork-point and --root both given' ' | ||||||
| 	test_must_fail git rebase --fork-point --root 2>err && | 	test_must_fail git rebase --fork-point --root 2>err && | ||||||
| 	test_i18ngrep "cannot combine" err | 	test_i18ngrep "cannot be used together" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'rebase.forkPoint set to false' ' | test_expect_success 'rebase.forkPoint set to false' ' | ||||||
|  |  | ||||||
|  | @ -67,10 +67,10 @@ test_expect_success 'error conditions' ' | ||||||
| 	echo fileA.t >list && | 	echo fileA.t >list && | ||||||
|  |  | ||||||
| 	test_must_fail git rm --pathspec-from-file=list -- fileA.t 2>err && | 	test_must_fail git rm --pathspec-from-file=list -- fileA.t 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && | 	test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git rm --pathspec-file-nul 2>err && | 	test_must_fail git rm --pathspec-file-nul 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err && | 	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && | ||||||
|  |  | ||||||
| 	>empty_list && | 	>empty_list && | ||||||
| 	test_must_fail git rm --pathspec-from-file=empty_list 2>err && | 	test_must_fail git rm --pathspec-from-file=empty_list 2>err && | ||||||
|  |  | ||||||
|  | @ -138,19 +138,19 @@ test_expect_success 'error conditions' ' | ||||||
| 	>empty_list && | 	>empty_list && | ||||||
|  |  | ||||||
| 	test_must_fail git add --pathspec-from-file=list --interactive 2>err && | 	test_must_fail git add --pathspec-from-file=list --interactive 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-from-file is incompatible with --interactive/--patch" err && | 	test_i18ngrep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git add --pathspec-from-file=list --patch 2>err && | 	test_must_fail git add --pathspec-from-file=list --patch 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-from-file is incompatible with --interactive/--patch" err && | 	test_i18ngrep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git add --pathspec-from-file=list --edit 2>err && | 	test_must_fail git add --pathspec-from-file=list --edit 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-from-file is incompatible with --edit" err && | 	test_i18ngrep -e "options .--pathspec-from-file. and .--edit. cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git add --pathspec-from-file=list -- fileA.t 2>err && | 	test_must_fail git add --pathspec-from-file=list -- fileA.t 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && | 	test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git add --pathspec-file-nul 2>err && | 	test_must_fail git add --pathspec-file-nul 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err && | 	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && | ||||||
|  |  | ||||||
| 	# This case succeeds, but still prints to stderr | 	# This case succeeds, but still prints to stderr | ||||||
| 	git add --pathspec-from-file=empty_list 2>err && | 	git add --pathspec-from-file=empty_list 2>err && | ||||||
|  |  | ||||||
|  | @ -88,13 +88,13 @@ test_expect_success 'error conditions' ' | ||||||
| 	echo fileA.t >list && | 	echo fileA.t >list && | ||||||
|  |  | ||||||
| 	test_must_fail git stash push --pathspec-from-file=list --patch 2>err && | 	test_must_fail git stash push --pathspec-from-file=list --patch 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-from-file is incompatible with --patch" err && | 	test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git stash push --pathspec-from-file=list -- fileA.t 2>err && | 	test_must_fail git stash push --pathspec-from-file=list -- fileA.t 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && | 	test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git stash push --pathspec-file-nul 2>err && | 	test_must_fail git stash push --pathspec-file-nul 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err | 	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_done | test_done | ||||||
|  |  | ||||||
|  | @ -63,21 +63,21 @@ test_expect_success 'usage' ' | ||||||
| 	test_i18ngrep "switch.*requires a value" err && | 	test_i18ngrep "switch.*requires a value" err && | ||||||
|  |  | ||||||
| 	test_expect_code 128 git log -Gregex -Sstring 2>err && | 	test_expect_code 128 git log -Gregex -Sstring 2>err && | ||||||
| 	grep "mutually exclusive" err && | 	grep "cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_expect_code 128 git log -Gregex --find-object=HEAD 2>err && | 	test_expect_code 128 git log -Gregex --find-object=HEAD 2>err && | ||||||
| 	grep "mutually exclusive" err && | 	grep "cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_expect_code 128 git log -Sstring --find-object=HEAD 2>err && | 	test_expect_code 128 git log -Sstring --find-object=HEAD 2>err && | ||||||
| 	grep "mutually exclusive" err && | 	grep "cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_expect_code 128 git log --pickaxe-all --find-object=HEAD 2>err && | 	test_expect_code 128 git log --pickaxe-all --find-object=HEAD 2>err && | ||||||
| 	grep "mutually exclusive" err | 	grep "cannot be used together" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'usage: --pickaxe-regex' ' | test_expect_success 'usage: --pickaxe-regex' ' | ||||||
| 	test_expect_code 128 git log -Gregex --pickaxe-regex 2>err && | 	test_expect_code 128 git log -Gregex --pickaxe-regex 2>err && | ||||||
| 	grep "mutually exclusive" err | 	grep "cannot be used together" err | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success 'usage: --no-pickaxe-regex' ' | test_expect_success 'usage: --no-pickaxe-regex' ' | ||||||
|  |  | ||||||
|  | @ -46,7 +46,7 @@ test_expect_success 'disallows --bare with --origin' ' | ||||||
|  |  | ||||||
| 	test_must_fail git clone -o foo --bare parent clone-bare-o 2>err && | 	test_must_fail git clone -o foo --bare parent clone-bare-o 2>err && | ||||||
| 	test_debug "cat err" && | 	test_debug "cat err" && | ||||||
| 	test_i18ngrep -e "--bare and --origin foo options are incompatible" err | 	test_i18ngrep -e "options .--bare. and .--origin foo. cannot be used together" err | ||||||
|  |  | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -54,7 +54,7 @@ test_expect_success 'disallows --bare with --separate-git-dir' ' | ||||||
|  |  | ||||||
| 	test_must_fail git clone --bare --separate-git-dir dot-git-destiation parent clone-bare-sgd 2>err && | 	test_must_fail git clone --bare --separate-git-dir dot-git-destiation parent clone-bare-sgd 2>err && | ||||||
| 	test_debug "cat err" && | 	test_debug "cat err" && | ||||||
| 	test_i18ngrep -e "--bare and --separate-git-dir are incompatible" err | 	test_i18ngrep -e "options .--bare. and .--separate-git-dir. cannot be used together" err | ||||||
|  |  | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  |  | ||||||
|  | @ -160,13 +160,13 @@ test_expect_success 'error conditions' ' | ||||||
| 	git rm fileA.t && | 	git rm fileA.t && | ||||||
|  |  | ||||||
| 	test_must_fail git reset --pathspec-from-file=list --patch 2>err && | 	test_must_fail git reset --pathspec-from-file=list --patch 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-from-file is incompatible with --patch" err && | 	test_i18ngrep -e "options .--pathspec-from-file. and .--patch. cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git reset --pathspec-from-file=list -- fileA.t 2>err && | 	test_must_fail git reset --pathspec-from-file=list -- fileA.t 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && | 	test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git reset --pathspec-file-nul 2>err && | 	test_must_fail git reset --pathspec-file-nul 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err && | 	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && | ||||||
|  |  | ||||||
| 	test_must_fail git reset --soft --pathspec-from-file=list 2>err && | 	test_must_fail git reset --soft --pathspec-from-file=list 2>err && | ||||||
| 	test_i18ngrep -e "fatal: Cannot do soft reset with paths" err && | 	test_i18ngrep -e "fatal: Cannot do soft reset with paths" err && | ||||||
|  |  | ||||||
|  | @ -359,14 +359,14 @@ test_expect_success '--fixup=reword: ignores staged changes' ' | ||||||
|  |  | ||||||
| test_expect_success '--fixup=reword: error out with -m option' ' | test_expect_success '--fixup=reword: error out with -m option' ' | ||||||
| 	commit_for_rebase_autosquash_setup && | 	commit_for_rebase_autosquash_setup && | ||||||
| 	echo "fatal: cannot combine -m with --fixup:reword" >expect && | 	echo "fatal: options '\''-m'\'' and '\''--fixup:reword'\'' cannot be used together" >expect && | ||||||
| 	test_must_fail git commit --fixup=reword:HEAD~ -m "reword commit message" 2>actual && | 	test_must_fail git commit --fixup=reword:HEAD~ -m "reword commit message" 2>actual && | ||||||
| 	test_cmp expect actual | 	test_cmp expect actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
| test_expect_success '--fixup=amend: error out with -m option' ' | test_expect_success '--fixup=amend: error out with -m option' ' | ||||||
| 	commit_for_rebase_autosquash_setup && | 	commit_for_rebase_autosquash_setup && | ||||||
| 	echo "fatal: cannot combine -m with --fixup:amend" >expect && | 	echo "fatal: options '\''-m'\'' and '\''--fixup:amend'\'' cannot be used together" >expect && | ||||||
| 	test_must_fail git commit --fixup=amend:HEAD~ -m "amend commit message" 2>actual && | 	test_must_fail git commit --fixup=amend:HEAD~ -m "amend commit message" 2>actual && | ||||||
| 	test_cmp expect actual | 	test_cmp expect actual | ||||||
| ' | ' | ||||||
|  | @ -421,8 +421,9 @@ test_expect_success 'amend! commit allows empty commit msg body with --allow-emp | ||||||
|  |  | ||||||
| test_fixup_reword_opt () { | test_fixup_reword_opt () { | ||||||
| 	test_expect_success "--fixup=reword: incompatible with $1" " | 	test_expect_success "--fixup=reword: incompatible with $1" " | ||||||
| 		echo 'fatal: reword option of --fixup is mutually exclusive with'\ | 		echo 'fatal: reword option of '\''--fixup'\'' and' \ | ||||||
| 			'--patch/--interactive/--all/--include/--only' >expect && | 			''\''--patch/--interactive/--all/--include/--only'\' \ | ||||||
|  | 			'cannot be used together' >expect && | ||||||
| 		test_must_fail git commit --fixup=reword:HEAD~ $1 2>actual && | 		test_must_fail git commit --fixup=reword:HEAD~ $1 2>actual && | ||||||
| 		test_cmp expect actual | 		test_cmp expect actual | ||||||
| 	" | 	" | ||||||
|  | @ -435,7 +436,7 @@ done | ||||||
|  |  | ||||||
| test_expect_success '--fixup=reword: give error with pathsec' ' | test_expect_success '--fixup=reword: give error with pathsec' ' | ||||||
| 	commit_for_rebase_autosquash_setup && | 	commit_for_rebase_autosquash_setup && | ||||||
| 	echo "fatal: cannot combine reword option of --fixup with path '\''foo'\''" >expect && | 	echo "fatal: reword option of '\''--fixup'\'' and path '\''foo'\'' cannot be used together" >expect && | ||||||
| 	test_must_fail git commit --fixup=reword:HEAD~ -- foo 2>actual && | 	test_must_fail git commit --fixup=reword:HEAD~ -- foo 2>actual && | ||||||
| 	test_cmp expect actual | 	test_cmp expect actual | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | @ -141,19 +141,19 @@ test_expect_success 'error conditions' ' | ||||||
| 	>empty_list && | 	>empty_list && | ||||||
|  |  | ||||||
| 	test_must_fail git commit --pathspec-from-file=list --interactive -m "Commit" 2>err && | 	test_must_fail git commit --pathspec-from-file=list --interactive -m "Commit" 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-from-file is incompatible with --interactive/--patch" err && | 	test_i18ngrep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git commit --pathspec-from-file=list --patch -m "Commit" 2>err && | 	test_must_fail git commit --pathspec-from-file=list --patch -m "Commit" 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-from-file is incompatible with --interactive/--patch" err && | 	test_i18ngrep -e "options .--pathspec-from-file. and .--interactive/--patch. cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git commit --pathspec-from-file=list --all -m "Commit" 2>err && | 	test_must_fail git commit --pathspec-from-file=list --all -m "Commit" 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-from-file with -a does not make sense" err && | 	test_i18ngrep -e "options .--pathspec-from-file. and .-a. cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git commit --pathspec-from-file=list -m "Commit" -- fileA.t 2>err && | 	test_must_fail git commit --pathspec-from-file=list -m "Commit" -- fileA.t 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-from-file is incompatible with pathspec arguments" err && | 	test_i18ngrep -e ".--pathspec-from-file. and pathspec arguments cannot be used together" err && | ||||||
|  |  | ||||||
| 	test_must_fail git commit --pathspec-file-nul -m "Commit" 2>err && | 	test_must_fail git commit --pathspec-file-nul -m "Commit" 2>err && | ||||||
| 	test_i18ngrep -e "--pathspec-file-nul requires --pathspec-from-file" err && | 	test_i18ngrep -e "the option .--pathspec-file-nul. requires .--pathspec-from-file." err && | ||||||
|  |  | ||||||
| 	test_must_fail git commit --pathspec-from-file=empty_list --include -m "Commit" 2>err && | 	test_must_fail git commit --pathspec-from-file=empty_list --include -m "Commit" 2>err && | ||||||
| 	test_i18ngrep -e "No paths with --include/--only does not make sense." err && | 	test_i18ngrep -e "No paths with --include/--only does not make sense." err && | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Junio C Hamano
						Junio C Hamano