Skip to content

Commit c17de5a

Browse files
committed
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"
2 parents 2c54104 + 246cac8 commit c17de5a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+189
-178
lines changed

apply.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ int check_apply_state(struct apply_state *state, int force_apply)
133133
int is_not_gitdir = !startup_info->have_repository;
134134

135135
if (state->apply_with_reject && state->threeway)
136-
return error(_("--reject and --3way cannot be used together."));
136+
return error(_("options '%s' and '%s' cannot be used together"), "--reject", "--3way");
137137
if (state->threeway) {
138138
if (is_not_gitdir)
139-
return error(_("--3way outside a repository"));
139+
return error(_("'%s' outside a repository"), "--3way");
140140
state->check_index = 1;
141141
}
142142
if (state->apply_with_reject) {
@@ -147,10 +147,10 @@ int check_apply_state(struct apply_state *state, int force_apply)
147147
if (!force_apply && (state->diffstat || state->numstat || state->summary || state->check || state->fake_ancestor))
148148
state->apply = 0;
149149
if (state->check_index && is_not_gitdir)
150-
return error(_("--index outside a repository"));
150+
return error(_("'%s' outside a repository"), "--index");
151151
if (state->cached) {
152152
if (is_not_gitdir)
153-
return error(_("--cached outside a repository"));
153+
return error(_("'%s' outside a repository"), "--cached");
154154
state->check_index = 1;
155155
}
156156
if (state->ita_only && (state->check_index || is_not_gitdir))

archive.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ static int write_archive_entry(const struct object_id *oid, const char *base,
185185

186186
buffer = object_file_to_archive(args, path.buf, oid, mode, &type, &size);
187187
if (!buffer)
188-
return error(_("cannot read %s"), oid_to_hex(oid));
188+
return error(_("cannot read '%s'"), oid_to_hex(oid));
189189
err = write_entry(args, oid, path.buf, path.len, mode, buffer, size);
190190
free(buffer);
191191
return err;
@@ -338,7 +338,7 @@ int write_archive_entries(struct archiver_args *args,
338338

339339
strbuf_reset(&content);
340340
if (strbuf_read_file(&content, path, info->stat.st_size) < 0)
341-
err = error_errno(_("could not read '%s'"), path);
341+
err = error_errno(_("cannot read '%s'"), path);
342342
else
343343
err = write_entry(args, &fake_oid, path_in_archive.buf,
344344
path_in_archive.len,
@@ -577,11 +577,11 @@ static int parse_archive_args(int argc, const char **argv,
577577
if (remote)
578578
die(_("Unexpected option --remote"));
579579
if (exec)
580-
die(_("Option --exec can only be used together with --remote"));
580+
die(_("the option '%s' requires '%s'"), "--exec", "--remote");
581581
if (output)
582582
die(_("Unexpected option --output"));
583583
if (is_remote && args->extra_files.nr)
584-
die(_("Options --add-file and --remote cannot be used together"));
584+
die(_("options '%s' and '%s' cannot be used together"), "--add-file", "--remote");
585585

586586
if (!base)
587587
base = "";

builtin/add.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,9 @@ int cmd_add(int argc, const char **argv, const char *prefix)
507507
add_interactive = 1;
508508
if (add_interactive) {
509509
if (show_only)
510-
die(_("--dry-run is incompatible with --interactive/--patch"));
510+
die(_("options '%s' and '%s' cannot be used together"), "--dry-run", "--interactive/--patch");
511511
if (pathspec_from_file)
512-
die(_("--pathspec-from-file is incompatible with --interactive/--patch"));
512+
die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--interactive/--patch");
513513
exit(interactive_add(argv + 1, prefix, patch_interactive));
514514
}
515515
if (legacy_stash_p) {
@@ -526,7 +526,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
526526

527527
if (edit_interactive) {
528528
if (pathspec_from_file)
529-
die(_("--pathspec-from-file is incompatible with --edit"));
529+
die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--edit");
530530
return(edit_patch(argc, argv, prefix));
531531
}
532532
argc--;
@@ -538,10 +538,10 @@ int cmd_add(int argc, const char **argv, const char *prefix)
538538
addremove = 0; /* "-u" was given but not "-A" */
539539

540540
if (addremove && take_worktree_changes)
541-
die(_("-A and -u are mutually incompatible"));
541+
die(_("options '%s' and '%s' cannot be used together"), "-A", "-u");
542542

543543
if (!show_only && ignore_missing)
544-
die(_("Option --ignore-missing can only be used together with --dry-run"));
544+
die(_("the option '%s' requires '%s'"), "--ignore-missing", "--dry-run");
545545

546546
if (chmod_arg && ((chmod_arg[0] != '-' && chmod_arg[0] != '+') ||
547547
chmod_arg[1] != 'x' || chmod_arg[2]))
@@ -566,14 +566,14 @@ int cmd_add(int argc, const char **argv, const char *prefix)
566566

567567
if (pathspec_from_file) {
568568
if (pathspec.nr)
569-
die(_("--pathspec-from-file is incompatible with pathspec arguments"));
569+
die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file");
570570

571571
parse_pathspec_file(&pathspec, PATHSPEC_ATTR,
572572
PATHSPEC_PREFER_FULL |
573573
PATHSPEC_SYMLINK_LEADING_PATH,
574574
prefix, pathspec_from_file, pathspec_file_nul);
575575
} else if (pathspec_file_nul) {
576-
die(_("--pathspec-file-nul requires --pathspec-from-file"));
576+
die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file");
577577
}
578578

579579
if (require_pathspec && pathspec.nr == 0) {

builtin/am.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2286,9 +2286,9 @@ static int parse_opt_show_current_patch(const struct option *opt, const char *ar
22862286
}
22872287

22882288
if (resume->mode == RESUME_SHOW_PATCH && new_value != resume->sub_mode)
2289-
return error(_("--show-current-patch=%s is incompatible with "
2290-
"--show-current-patch=%s"),
2291-
arg, valid_modes[resume->sub_mode]);
2289+
return error(_("options '%s=%s' and '%s=%s' "
2290+
"cannot be used together"),
2291+
"--show-current-patch", "--show-current-patch", arg, valid_modes[resume->sub_mode]);
22922292

22932293
resume->mode = RESUME_SHOW_PATCH;
22942294
resume->sub_mode = new_value;

builtin/branch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
724724
finalize_colopts(&colopts, -1);
725725
if (filter.verbose) {
726726
if (explicitly_enable_column(colopts))
727-
die(_("--column and --verbose are incompatible"));
727+
die(_("options '%s' and '%s' cannot be used together"), "--column", "--verbose");
728728
colopts = 0;
729729
}
730730

builtin/cat-file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
729729
}
730730

731731
if (force_path && batch.enabled) {
732-
error("--path=<path> incompatible with --batch");
732+
error("options '--path=<path>' and '--batch' cannot be used together");
733733
usage_with_options(cat_file_usage, options);
734734
}
735735

builtin/checkout.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,10 @@ static int checkout_paths(const struct checkout_opts *opts,
464464
die(_("'%s' cannot be used with updating paths"), "--detach");
465465

466466
if (opts->merge && opts->patch_mode)
467-
die(_("'%s' cannot be used with %s"), "--merge", "--patch");
467+
die(_("options '%s' and '%s' cannot be used together"), "--merge", "--patch");
468468

469469
if (opts->ignore_unmerged && opts->merge)
470-
die(_("'%s' cannot be used with %s"),
470+
die(_("options '%s' and '%s' cannot be used together"),
471471
opts->ignore_unmerged_opt, "-m");
472472

473473
if (opts->new_branch)
@@ -1637,11 +1637,11 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
16371637
}
16381638

16391639
if ((!!opts->new_branch + !!opts->new_branch_force + !!opts->new_orphan_branch) > 1)
1640-
die(_("-%c, -%c and --orphan are mutually exclusive"),
1641-
cb_option, toupper(cb_option));
1640+
die(_("options '-%c', '-%c', and '%s' cannot be used together"),
1641+
cb_option, toupper(cb_option), "--orphan");
16421642

16431643
if (opts->overlay_mode == 1 && opts->patch_mode)
1644-
die(_("-p and --overlay are mutually exclusive"));
1644+
die(_("options '%s' and '%s' cannot be used together"), "-p", "--overlay");
16451645

16461646
if (opts->checkout_index >= 0 || opts->checkout_worktree >= 0) {
16471647
if (opts->checkout_index < 0)
@@ -1748,19 +1748,19 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
17481748

17491749
if (opts->pathspec_from_file) {
17501750
if (opts->pathspec.nr)
1751-
die(_("--pathspec-from-file is incompatible with pathspec arguments"));
1751+
die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file");
17521752

17531753
if (opts->force_detach)
1754-
die(_("--pathspec-from-file is incompatible with --detach"));
1754+
die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--detach");
17551755

17561756
if (opts->patch_mode)
1757-
die(_("--pathspec-from-file is incompatible with --patch"));
1757+
die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--patch");
17581758

17591759
parse_pathspec_file(&opts->pathspec, 0,
17601760
0,
17611761
prefix, opts->pathspec_from_file, opts->pathspec_file_nul);
17621762
} else if (opts->pathspec_file_nul) {
1763-
die(_("--pathspec-file-nul requires --pathspec-from-file"));
1763+
die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file");
17641764
}
17651765

17661766
opts->pathspec.recursive = 1;

builtin/clone.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -900,10 +900,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
900900

901901
if (option_bare) {
902902
if (option_origin)
903-
die(_("--bare and --origin %s options are incompatible."),
904-
option_origin);
903+
die(_("options '%s' and '%s %s' cannot be used together"),
904+
"--bare", "--origin", option_origin);
905905
if (real_git_dir)
906-
die(_("--bare and --separate-git-dir are incompatible."));
906+
die(_("options '%s' and '%s' cannot be used together"), "--bare", "--separate-git-dir");
907907
option_no_checkout = 1;
908908
}
909909

builtin/commit.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -355,19 +355,19 @@ static const char *prepare_index(const char **argv, const char *prefix,
355355

356356
if (pathspec_from_file) {
357357
if (interactive)
358-
die(_("--pathspec-from-file is incompatible with --interactive/--patch"));
358+
die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--interactive/--patch");
359359

360360
if (all)
361-
die(_("--pathspec-from-file with -a does not make sense"));
361+
die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "-a");
362362

363363
if (pathspec.nr)
364-
die(_("--pathspec-from-file is incompatible with pathspec arguments"));
364+
die(_("'%s' and pathspec arguments cannot be used together"), "--pathspec-from-file");
365365

366366
parse_pathspec_file(&pathspec, 0,
367367
PATHSPEC_PREFER_FULL,
368368
prefix, pathspec_from_file, pathspec_file_nul);
369369
} else if (pathspec_file_nul) {
370-
die(_("--pathspec-file-nul requires --pathspec-from-file"));
370+
die(_("the option '%s' requires '%s'"), "--pathspec-file-nul", "--pathspec-from-file");
371371
}
372372

373373
if (!pathspec.nr && (also || (only && !allow_empty &&
@@ -799,7 +799,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
799799

800800
if (!strcmp(fixup_prefix, "amend")) {
801801
if (have_option_m)
802-
die(_("cannot combine -m with --fixup:%s"), fixup_message);
802+
die(_("options '%s' and '%s:%s' cannot be used together"), "-m", "--fixup", fixup_message);
803803
prepare_amend_commit(commit, &sb, &ctx);
804804
}
805805
} else if (!stat(git_path_merge_msg(the_repository), &statbuf)) {
@@ -1193,7 +1193,7 @@ static void finalize_deferred_config(struct wt_status *s)
11931193
status_format == STATUS_FORMAT_UNSPECIFIED)
11941194
status_format = STATUS_FORMAT_PORCELAIN;
11951195
else if (status_format == STATUS_FORMAT_LONG)
1196-
die(_("--long and -z are incompatible"));
1196+
die(_("options '%s' and '%s' cannot be used together"), "--long", "-z");
11971197
}
11981198

11991199
if (use_deferred_config && status_format == STATUS_FORMAT_UNSPECIFIED)
@@ -1229,9 +1229,10 @@ static void check_fixup_reword_options(int argc, const char *argv[]) {
12291229
die(_("You are in the middle of a cherry-pick -- cannot reword."));
12301230
}
12311231
if (argc)
1232-
die(_("cannot combine reword option of --fixup with path '%s'"), *argv);
1232+
die(_("reword option of '%s' and path '%s' cannot be used together"), "--fixup", *argv);
12331233
if (patch_interactive || interactive || all || also || only)
1234-
die(_("reword option of --fixup is mutually exclusive with --patch/--interactive/--all/--include/--only"));
1234+
die(_("reword option of '%s' and '%s' cannot be used together"),
1235+
"--fixup", "--patch/--interactive/--all/--include/--only");
12351236
}
12361237

12371238
static int parse_and_validate_options(int argc, const char *argv[],

builtin/describe.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
590590
save_commit_buffer = 0;
591591

592592
if (longformat && abbrev == 0)
593-
die(_("--long is incompatible with --abbrev=0"));
593+
die(_("options '%s' and '%s' cannot be used together"), "--long", "--abbrev=0");
594594

595595
if (contains) {
596596
struct string_list_item *item;
@@ -670,9 +670,9 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
670670
}
671671
describe("HEAD", 1);
672672
} else if (dirty) {
673-
die(_("--dirty is incompatible with commit-ishes"));
673+
die(_("option '%s' and commit-ishes cannot be used together"), "--dirty");
674674
} else if (broken) {
675-
die(_("--broken is incompatible with commit-ishes"));
675+
die(_("option '%s' and commit-ishes cannot be used together"), "--broken");
676676
} else {
677677
while (argc-- > 0)
678678
describe(*argv++, argc == 0);

0 commit comments

Comments
 (0)