From: Junio C Hamano Date: Wed, 15 Aug 2018 22:08:23 +0000 (-0700) Subject: Merge branch 'nd/i18n' X-Git-Tag: v2.19.0-rc0~74 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4bea8485e395769951c6b9eddfba1081ea7ef47f;p=thirdparty%2Fgit.git Merge branch 'nd/i18n' Many more strings are prepared for l10n. * nd/i18n: (23 commits) transport-helper.c: mark more strings for translation transport.c: mark more strings for translation sha1-file.c: mark more strings for translation sequencer.c: mark more strings for translation replace-object.c: mark more strings for translation refspec.c: mark more strings for translation refs.c: mark more strings for translation pkt-line.c: mark more strings for translation object.c: mark more strings for translation exec-cmd.c: mark more strings for translation environment.c: mark more strings for translation dir.c: mark more strings for translation convert.c: mark more strings for translation connect.c: mark more strings for translation config.c: mark more strings for translation commit-graph.c: mark more strings for translation builtin/replace.c: mark more strings for translation builtin/pack-objects.c: mark more strings for translation builtin/grep.c: mark strings for translation builtin/config.c: mark more strings for translation ... --- 4bea8485e395769951c6b9eddfba1081ea7ef47f diff --cc builtin/commit.c index 158e3f843a,d3276a10b2..213fca2d8e --- a/builtin/commit.c +++ b/builtin/commit.c @@@ -1639,17 -1639,17 +1639,17 @@@ int cmd_commit(int argc, const char **a die("%s", err.buf); } - unlink(git_path_cherry_pick_head()); - unlink(git_path_revert_head()); - unlink(git_path_merge_head()); - unlink(git_path_merge_msg()); - unlink(git_path_merge_mode()); - unlink(git_path_squash_msg()); + unlink(git_path_cherry_pick_head(the_repository)); + unlink(git_path_revert_head(the_repository)); + unlink(git_path_merge_head(the_repository)); + unlink(git_path_merge_msg(the_repository)); + unlink(git_path_merge_mode(the_repository)); + unlink(git_path_squash_msg(the_repository)); if (commit_index_files()) - die (_("Repository has been updated, but unable to write\n" - "new_index file. Check that disk is not full and quota is\n" - "not exceeded, and then \"git reset HEAD\" to recover.")); + die(_("repository has been updated, but unable to write\n" + "new_index file. Check that disk is not full and quota is\n" + "not exceeded, and then \"git reset HEAD\" to recover.")); rerere(0); run_command_v_opt(argv_gc_auto, RUN_GIT_CMD); diff --cc builtin/config.c index 2c93a289a7,5761a2c4ac..97b58c4aea --- a/builtin/config.c +++ b/builtin/config.c @@@ -110,8 -110,9 +110,8 @@@ static int option_parse_type(const stru * --int' and '--type=bool * --type=int'. */ - error("only one type at a time."); + error(_("only one type at a time")); - usage_with_options(builtin_config_usage, - builtin_config_options); + usage_builtin_config(); } *to_type = new_type; @@@ -164,8 -160,12 +164,12 @@@ static NORETURN void usage_builtin_conf static void check_argc(int argc, int min, int max) { if (argc >= min && argc <= max) return; - error("wrong number of arguments"); + if (min == max) + error(_("wrong number of arguments, should be %d"), min); + else + error(_("wrong number of arguments, should be from %d to %d"), + min, max); - usage_with_options(builtin_config_usage, builtin_config_options); + usage_builtin_config(); } static void show_config_origin(struct strbuf *buf) @@@ -599,8 -599,8 +603,8 @@@ int cmd_config(int argc, const char **a if (use_global_config + use_system_config + use_local_config + !!given_config_source.file + !!given_config_source.blob > 1) { - error("only one config file at a time."); + error(_("only one config file at a time")); - usage_with_options(builtin_config_usage, builtin_config_options); + usage_builtin_config(); } if (use_local_config && nongit) @@@ -663,13 -663,13 +667,13 @@@ } if ((actions & (ACTION_GET_COLOR|ACTION_GET_COLORBOOL)) && type) { - error("--get-color and variable type are incoherent"); + error(_("--get-color and variable type are incoherent")); - usage_with_options(builtin_config_usage, builtin_config_options); + usage_builtin_config(); } if (HAS_MULTI_BITS(actions)) { - error("only one action at a time."); + error(_("only one action at a time")); - usage_with_options(builtin_config_usage, builtin_config_options); + usage_builtin_config(); } if (actions == 0) switch (argc) { @@@ -681,20 -681,21 +685,20 @@@ } if (omit_values && !(actions == ACTION_LIST || actions == ACTION_GET_REGEXP)) { - error("--name-only is only applicable to --list or --get-regexp"); + error(_("--name-only is only applicable to --list or --get-regexp")); - usage_with_options(builtin_config_usage, builtin_config_options); + usage_builtin_config(); } if (show_origin && !(actions & (ACTION_GET|ACTION_GET_ALL|ACTION_GET_REGEXP|ACTION_LIST))) { - error("--show-origin is only applicable to --get, --get-all, " - "--get-regexp, and --list."); + error(_("--show-origin is only applicable to --get, --get-all, " + "--get-regexp, and --list")); - usage_with_options(builtin_config_usage, builtin_config_options); + usage_builtin_config(); } if (default_value && !(actions & ACTION_GET)) { - error("--default is only applicable to --get"); + error(_("--default is only applicable to --get")); - usage_with_options(builtin_config_usage, - builtin_config_options); + usage_builtin_config(); } if (actions & PAGING_ACTIONS) diff --cc builtin/fast-export.c index 223499d7ca,83c482581b..9bd8a14b57 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@@ -241,11 -240,10 +241,11 @@@ static void export_blob(const struct ob } else { buf = read_object_file(oid, &type, &size); if (!buf) - die ("Could not read blob %s", oid_to_hex(oid)); + die("could not read blob %s", oid_to_hex(oid)); if (check_object_signature(oid, buf, size, type_name(type)) < 0) die("sha1 mismatch in blob %s", oid_to_hex(oid)); - object = parse_object_buffer(oid, type, size, buf, &eaten); + object = parse_object_buffer(the_repository, oid, type, + size, buf, &eaten); } if (!object) diff --cc builtin/grep.c index 056161f0f8,58f941e951..ee5a1bd355 --- a/builtin/grep.c +++ b/builtin/grep.c @@@ -963,12 -959,8 +963,12 @@@ int cmd_grep(int argc, const char **arg } if (!opt.pattern_list) - die(_("no pattern given.")); + die(_("no pattern given")); + /* --only-matching has no effect with --invert. */ + if (opt.invert) + opt.only_matching = 0; + /* * We have to find "--" in a separate pass, because its presence * influences how we will parse arguments that come before it. diff --cc builtin/pack-objects.c index 33f23f99ce,37d63f6721..3848f3782d --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@@ -2474,10 -2480,10 +2480,10 @@@ static void add_tag_chain(const struct if (packlist_find(&to_pack, oid->hash, NULL)) return; - tag = lookup_tag(oid); + tag = lookup_tag(the_repository, oid); while (1) { if (!tag || parse_tag(tag) || !tag->tagged) - die("unable to pack objects reachable from tag %s", + die(_("unable to pack objects reachable from tag %s"), oid_to_hex(oid)); add_object_entry(&tag->object.oid, OBJ_TAG, NULL, 0); diff --cc builtin/replace.c index e997a562f0,e879ace277..4f05791f3e --- a/builtin/replace.c +++ b/builtin/replace.c @@@ -368,10 -368,10 +368,10 @@@ static int replace_parents(struct strbu struct object_id oid; if (get_oid(argv[i], &oid) < 0) { strbuf_release(&new_parents); - return error(_("Not a valid object name: '%s'"), + return error(_("not a valid object name: '%s'"), argv[i]); } - if (!lookup_commit_reference(&oid)) { + if (!lookup_commit_reference(the_repository, &oid)) { strbuf_release(&new_parents); return error(_("could not parse %s"), argv[i]); } @@@ -442,8 -442,8 +442,8 @@@ static int create_graft(int argc, cons unsigned long size; if (get_oid(old_ref, &old_oid) < 0) - return error(_("Not a valid object name: '%s'"), old_ref); + return error(_("not a valid object name: '%s'"), old_ref); - commit = lookup_commit_reference(&old_oid); + commit = lookup_commit_reference(the_repository, &old_oid); if (!commit) return error(_("could not parse %s"), old_ref); diff --cc commit-graph.c index b0a55ad128,c8d521923c..0034740c26 --- a/commit-graph.c +++ b/commit-graph.c @@@ -251,14 -241,10 +251,14 @@@ static struct commit_list **insert_pare { struct commit *c; struct object_id oid; + + if (pos >= g->num_commits) + die("invalid parent position %"PRIu64, pos); + hashcpy(oid.hash, g->chunk_oid_lookup + g->hash_len * pos); - c = lookup_commit(&oid); + c = lookup_commit(the_repository, &oid); if (!c) - die("could not find commit %s", oid_to_hex(&oid)); + die(_("could not find commit %s"), oid_to_hex(&oid)); c->graph_pos = pos; return &commit_list_insert(c, pptr)->next; } @@@ -721,15 -677,15 +721,15 @@@ void write_commit_graph(const char *obj int dirlen; strbuf_addf(&packname, "%s/pack/", obj_dir); dirlen = packname.len; - for (i = 0; i < nr_packs; i++) { + for (i = 0; i < pack_indexes->nr; i++) { struct packed_git *p; strbuf_setlen(&packname, dirlen); - strbuf_addstr(&packname, pack_indexes[i]); + strbuf_addstr(&packname, pack_indexes->items[i].string); p = add_packed_git(packname.buf, packname.len, 1); if (!p) - die("error adding pack %s", packname.buf); + die(_("error adding pack %s"), packname.buf); if (open_pack_index(p)) - die("error opening index for %s", packname.buf); + die(_("error opening index for %s"), packname.buf); for_each_object_in_pack(p, add_packed_commits, &oids); close_pack(p); } diff --cc config.c index efe27d5e52,736b9f23f7..10522f399e --- a/config.c +++ b/config.c @@@ -1603,14 -1589,13 +1603,14 @@@ int git_config_from_blob_oid(config_fn_ buf = read_object_file(oid, &type, &size); if (!buf) - return error("unable to load config blob object '%s'", name); + return error(_("unable to load config blob object '%s'"), name); if (type != OBJ_BLOB) { free(buf); - return error("reference '%s' does not point to a blob", name); + return error(_("reference '%s' does not point to a blob"), name); } - ret = git_config_from_mem(fn, CONFIG_ORIGIN_BLOB, name, buf, size, data); + ret = git_config_from_mem(fn, CONFIG_ORIGIN_BLOB, name, buf, size, + data, NULL); free(buf); return ret; diff --cc object.c index e2c112cc1a,477e686da7..51c4594515 --- a/object.c +++ b/object.c @@@ -261,13 -260,13 +261,13 @@@ struct object *parse_object(struct repo if ((obj && obj->type == OBJ_BLOB && has_object_file(oid)) || (!obj && has_object_file(oid) && - oid_object_info(the_repository, oid, NULL) == OBJ_BLOB)) { + oid_object_info(r, oid, NULL) == OBJ_BLOB)) { if (check_object_signature(repl, NULL, 0, NULL) < 0) { - error("sha1 mismatch %s", oid_to_hex(oid)); + error(_("sha1 mismatch %s"), oid_to_hex(oid)); return NULL; } - parse_blob_buffer(lookup_blob(oid), NULL, 0); - return lookup_object(oid->hash); + parse_blob_buffer(lookup_blob(r, oid), NULL, 0); + return lookup_object(r, oid->hash); } buffer = read_object_file(oid, &type, &size); diff --cc sha1-file.c index dfa8a35d68,92c27583db..c6ca960eb2 --- a/sha1-file.c +++ b/sha1-file.c @@@ -1801,16 -1801,16 +1801,16 @@@ static void check_commit(const void *bu { struct commit c; memset(&c, 0, sizeof(c)); - if (parse_commit_buffer(&c, buf, size, 0)) + if (parse_commit_buffer(the_repository, &c, buf, size, 0)) - die("corrupt commit"); + die(_("corrupt commit")); } static void check_tag(const void *buf, size_t size) { struct tag t; memset(&t, 0, sizeof(t)); - if (parse_tag_buffer(&t, buf, size)) + if (parse_tag_buffer(the_repository, &t, buf, size)) - die("corrupt tag"); + die(_("corrupt tag")); } static int index_mem(struct object_id *oid, void *buf, size_t size,