Merge branch 'nd/i18n'
authorJunio C Hamano <gitster@pobox.com>
Wed, 15 Aug 2018 22:08:23 +0000 (15:08 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Aug 2018 22:08:23 +0000 (15:08 -0700)
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
...

33 files changed:
1  2 
archive-tar.c
archive-zip.c
builtin/blame.c
builtin/checkout.c
builtin/commit.c
builtin/config.c
builtin/fast-export.c
builtin/fmt-merge-msg.c
builtin/grep.c
builtin/log.c
builtin/merge.c
builtin/pack-objects.c
builtin/replace.c
commit-graph.c
config.c
convert.c
diff.c
dir.c
environment.c
object.c
reflog-walk.c
refs.c
replace-object.c
sequencer.c
sha1-file.c
t/t0021-conversion.sh
t/t3210-pack-refs.sh
t/t5500-fetch-pack.sh
t/t5505-remote.sh
t/t5801-remote-helpers.sh
t/t7400-submodule-basic.sh
transport-helper.c
transport.c
diff --cc archive-tar.c
Simple merge
diff --cc archive-zip.c
Simple merge
diff --cc builtin/blame.c
Simple merge
Simple merge
index 158e3f843afbf889e26328f29cb2894f17da4ee1,d3276a10b2a09426f99cde3a43f07fc22136c72c..213fca2d8ecdf726661e6b31b7ec6cb004acb2f7
@@@ -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);
index 2c93a289a7255c69260a806cc064f00170453531,5761a2c4ac25d3f90938f9830d4c9d7eebaa9a92..97b58c4aeac4a390148192578d92191407ec7e13
@@@ -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)
        }
  
        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) {
                }
        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)
index 223499d7ca4616553c6a7029f6534634f2fa93a5,83c482581b585116f5b78957b2f7a81a6b21a36e..9bd8a14b57b8e1b014503dffbcffa27e7242d67a
@@@ -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)
Simple merge
diff --cc builtin/grep.c
index 056161f0f88596a6074ef6edddeaa6c894d8b801,58f941e951949ab9a3d7c2cc34e9072da550d314..ee5a1bd355a5f239a23b524a3e05b9c8646f6bc8
@@@ -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/log.c
Simple merge
diff --cc builtin/merge.c
Simple merge
index 33f23f99ceba8f52271f50759142579f656bcdf4,37d63f6721c79382f3ef24fad48f7f305177ff5e..3848f3782dd08eaf23c4ff1d889f7e2623bdd992
@@@ -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);
index e997a562f0fc9201f22b3a162621d3888dc1b70c,e879ace2774d3cb587d0ef742b7e53e3a14a9405..4f05791f3e895f78ba511dd6571bd09abab9269c
@@@ -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 b0a55ad128fbcaa2e34c25b8487856d20d0ad3d5,c8d521923c29fbc48d36ff3bd7cd02d5638b910e..0034740c26b48eda147d45258505df278b84cc0a
@@@ -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 efe27d5e525a8ce15d588c0dad1fff184952b927,736b9f23f7edb28601fe3505df34e86c0cbfddfb..10522f399e6eb5300b55eaeaf8fcbf6546e53d11
+++ 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 convert.c
Simple merge
diff --cc diff.c
Simple merge
diff --cc dir.c
Simple merge
diff --cc environment.c
Simple merge
diff --cc object.c
index e2c112cc1a757f666ce3ca234227c98abf146910,477e686da7dc783a5341888bb987a42226d75795..51c45945156c421ada403139faefdf145918f4f7
+++ 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 reflog-walk.c
Simple merge
diff --cc refs.c
Simple merge
Simple merge
diff --cc sequencer.c
Simple merge
diff --cc sha1-file.c
index dfa8a35d68d9b40d4fa30cff15c1f027a201192e,92c27583db03251fdfdfa9e9b0b19a3c64a9ac11..c6ca960eb2aa6b70841350d894bfda77856d980a
@@@ -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,
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc transport.c
Simple merge