THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Browse Source

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
  ...
tags/v2.19.0-rc0
Junio C Hamano 1 year ago
parent
commit
4bea8485e3
47 changed files with 502 additions and 483 deletions
  1. +6
    -6
      archive-tar.c
  2. +7
    -7
      archive-zip.c
  3. +1
    -1
      builtin/blame.c
  4. +2
    -2
      builtin/checkout.c
  5. +3
    -3
      builtin/commit.c
  6. +27
    -23
      builtin/config.c
  7. +21
    -21
      builtin/fast-export.c
  8. +1
    -1
      builtin/fmt-merge-msg.c
  9. +6
    -6
      builtin/grep.c
  10. +3
    -3
      builtin/log.c
  11. +1
    -1
      builtin/merge.c
  12. +61
    -54
      builtin/pack-objects.c
  13. +42
    -42
      builtin/replace.c
  14. +1
    -1
      builtin/rm.c
  15. +10
    -10
      commit-graph.c
  16. +36
    -36
      config.c
  17. +40
    -37
      connect.c
  18. +22
    -20
      convert.c
  19. +2
    -2
      diff.c
  20. +4
    -4
      dir.c
  21. +2
    -2
      environment.c
  22. +1
    -1
      exec-cmd.c
  23. +5
    -5
      object.c
  24. +13
    -13
      pkt-line.c
  25. +2
    -2
      reflog-walk.c
  26. +20
    -20
      refs.c
  27. +1
    -1
      refspec.c
  28. +3
    -3
      replace-object.c
  29. +15
    -13
      sequencer.c
  30. +55
    -55
      sha1-file.c
  31. +1
    -1
      t/t0021-conversion.sh
  32. +1
    -1
      t/t1305-config-include.sh
  33. +1
    -1
      t/t1308-config-set.sh
  34. +10
    -10
      t/t1400-update-ref.sh
  35. +2
    -2
      t/t1404-update-ref-errors.sh
  36. +1
    -1
      t/t1450-fsck.sh
  37. +4
    -4
      t/t3005-ls-files-relative.sh
  38. +1
    -1
      t/t3210-pack-refs.sh
  39. +3
    -3
      t/t3310-notes-merge-manual-resolve.sh
  40. +1
    -1
      t/t5500-fetch-pack.sh
  41. +1
    -1
      t/t5505-remote.sh
  42. +3
    -3
      t/t5570-git-daemon.sh
  43. +4
    -4
      t/t5801-remote-helpers.sh
  44. +1
    -1
      t/t7063-status-untracked-cache.sh
  45. +1
    -1
      t/t7400-submodule-basic.sh
  46. +45
    -44
      transport-helper.c
  47. +9
    -9
      transport.c

+ 6
- 6
archive-tar.c View File

@@ -122,7 +122,7 @@ static int stream_blocked(const struct object_id *oid)

st = open_istream(oid, &type, &sz, NULL);
if (!st)
return error("cannot stream blob %s", oid_to_hex(oid));
return error(_("cannot stream blob %s"), oid_to_hex(oid));
for (;;) {
readlen = read_istream(st, buf, sizeof(buf));
if (readlen <= 0)
@@ -257,7 +257,7 @@ static int write_tar_entry(struct archiver_args *args,
*header.typeflag = TYPEFLAG_REG;
mode = (mode | ((mode & 0100) ? 0777 : 0666)) & ~tar_umask;
} else {
return error("unsupported file mode: 0%o (SHA1: %s)",
return error(_("unsupported file mode: 0%o (SHA1: %s)"),
mode, oid_to_hex(oid));
}
if (pathlen > sizeof(header.name)) {
@@ -284,7 +284,7 @@ static int write_tar_entry(struct archiver_args *args,
enum object_type type;
buffer = object_file_to_archive(args, path, oid, old_mode, &type, &size);
if (!buffer)
return error("cannot read %s", oid_to_hex(oid));
return error(_("cannot read %s"), oid_to_hex(oid));
} else {
buffer = NULL;
size = 0;
@@ -455,17 +455,17 @@ static int write_tar_filter_archive(const struct archiver *ar,
filter.in = -1;

if (start_command(&filter) < 0)
die_errno("unable to start '%s' filter", argv[0]);
die_errno(_("unable to start '%s' filter"), argv[0]);
close(1);
if (dup2(filter.in, 1) < 0)
die_errno("unable to redirect descriptor");
die_errno(_("unable to redirect descriptor"));
close(filter.in);

r = write_tar_archive(ar, args);

close(1);
if (finish_command(&filter) != 0)
die("'%s' filter reported error", argv[0]);
die(_("'%s' filter reported error"), argv[0]);

strbuf_release(&cmd);
return r;

+ 7
- 7
archive-zip.c View File

@@ -310,11 +310,11 @@ static int write_zip_entry(struct archiver_args *args,
if (is_utf8(path))
flags |= ZIP_UTF8;
else
warning("Path is not valid UTF-8: %s", path);
warning(_("path is not valid UTF-8: %s"), path);
}

if (pathlen > 0xffff) {
return error("path too long (%d chars, SHA1: %s): %s",
return error(_("path too long (%d chars, SHA1: %s): %s"),
(int)pathlen, oid_to_hex(oid), path);
}

@@ -341,7 +341,7 @@ static int write_zip_entry(struct archiver_args *args,
size > big_file_threshold) {
stream = open_istream(oid, &type, &size, NULL);
if (!stream)
return error("cannot stream blob %s",
return error(_("cannot stream blob %s"),
oid_to_hex(oid));
flags |= ZIP_STREAM;
out = buffer = NULL;
@@ -349,7 +349,7 @@ static int write_zip_entry(struct archiver_args *args,
buffer = object_file_to_archive(args, path, oid, mode,
&type, &size);
if (!buffer)
return error("cannot read %s",
return error(_("cannot read %s"),
oid_to_hex(oid));
crc = crc32(crc, buffer, size);
is_binary = entry_is_binary(path_without_prefix,
@@ -358,7 +358,7 @@ static int write_zip_entry(struct archiver_args *args,
}
compressed_size = (method == 0) ? size : 0;
} else {
return error("unsupported file mode: 0%o (SHA1: %s)", mode,
return error(_("unsupported file mode: 0%o (SHA1: %s)"), mode,
oid_to_hex(oid));
}

@@ -467,7 +467,7 @@ static int write_zip_entry(struct archiver_args *args,
zstream.avail_in = readlen;
result = git_deflate(&zstream, 0);
if (result != Z_OK)
die("deflate error (%d)", result);
die(_("deflate error (%d)"), result);
out_len = zstream.next_out - compressed;

if (out_len > 0) {
@@ -602,7 +602,7 @@ static void dos_time(timestamp_t *timestamp, int *dos_date, int *dos_time)
struct tm *t;

if (date_overflows(*timestamp))
die("timestamp too large for this system: %"PRItime,
die(_("timestamp too large for this system: %"PRItime),
*timestamp);
time = (time_t)*timestamp;
t = localtime(&time);

+ 1
- 1
builtin/blame.c View File

@@ -410,7 +410,7 @@ static void parse_color_fields(const char *s)
}

if (next == EXPECT_COLOR)
die (_("must end with a color"));
die(_("must end with a color"));

colorfield[colorfield_nr].hop = TIME_MAX;
string_list_clear(&l, 0);

+ 2
- 2
builtin/checkout.c View File

@@ -1198,12 +1198,12 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
if (opts.track != BRANCH_TRACK_UNSPECIFIED && !opts.new_branch) {
const char *argv0 = argv[0];
if (!argc || !strcmp(argv0, "--"))
die (_("--track needs a branch name"));
die(_("--track needs a branch name"));
skip_prefix(argv0, "refs/", &argv0);
skip_prefix(argv0, "remotes/", &argv0);
argv0 = strchr(argv0, '/');
if (!argv0 || !argv0[1])
die (_("Missing branch name; try -b"));
die(_("missing branch name; try -b"));
opts.new_branch = argv0 + 1;
}


+ 3
- 3
builtin/commit.c View File

@@ -1647,9 +1647,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
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);

+ 27
- 23
builtin/config.c View File

@@ -110,7 +110,7 @@ static int option_parse_type(const struct option *opt, const char *arg,
* --int' and '--type=bool
* --type=int'.
*/
error("only one type at a time.");
error(_("only one type at a time"));
usage_builtin_config();
}
*to_type = new_type;
@@ -164,7 +164,11 @@ static NORETURN void usage_builtin_config(void)
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_builtin_config();
}

@@ -297,7 +301,7 @@ static int get_value(const char *key_, const char *regex_)

key_regexp = (regex_t*)xmalloc(sizeof(regex_t));
if (regcomp(key_regexp, key, REG_EXTENDED)) {
error("invalid key pattern: %s", key_);
error(_("invalid key pattern: %s"), key_);
FREE_AND_NULL(key_regexp);
ret = CONFIG_INVALID_PATTERN;
goto free_strings;
@@ -317,7 +321,7 @@ static int get_value(const char *key_, const char *regex_)

regexp = (regex_t*)xmalloc(sizeof(regex_t));
if (regcomp(regexp, regex_, REG_EXTENDED)) {
error("invalid pattern: %s", regex_);
error(_("invalid pattern: %s"), regex_);
FREE_AND_NULL(regexp);
ret = CONFIG_INVALID_PATTERN;
goto free_strings;
@@ -390,7 +394,7 @@ static char *normalize_value(const char *key, const char *value)
if (type == TYPE_COLOR) {
char v[COLOR_MAXLEN];
if (git_config_color(v, key, value))
die("cannot parse color '%s'", value);
die(_("cannot parse color '%s'"), value);

/*
* The contents of `v` now contain an ANSI escape
@@ -485,13 +489,13 @@ static int get_colorbool(const char *var, int print)
static void check_write(void)
{
if (!given_config_source.file && !startup_info->have_repository)
die("not in a git directory");
die(_("not in a git directory"));

if (given_config_source.use_stdin)
die("writing to stdin is not supported");
die(_("writing to stdin is not supported"));

if (given_config_source.blob)
die("writing config blobs is not supported");
die(_("writing config blobs is not supported"));
}

struct urlmatch_current_candidate_value {
@@ -599,7 +603,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)

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_builtin_config();
}

@@ -626,7 +630,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
* location; error out even if XDG_CONFIG_HOME
* is set and points at a sane location.
*/
die("$HOME not set");
die(_("$HOME not set"));

if (access_or_warn(user_config, R_OK, 0) &&
xdg_config && !access_or_warn(xdg_config, R_OK, 0)) {
@@ -663,12 +667,12 @@ int cmd_config(int argc, const char **argv, const char *prefix)
}

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_builtin_config();
}

if (HAS_MULTI_BITS(actions)) {
error("only one action at a time.");
error(_("only one action at a time"));
usage_builtin_config();
}
if (actions == 0)
@@ -681,19 +685,19 @@ int cmd_config(int argc, const char **argv, const char *prefix)
}
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_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_builtin_config();
}

if (default_value && !(actions & ACTION_GET)) {
error("--default is only applicable to --get");
error(_("--default is only applicable to --get"));
usage_builtin_config();
}

@@ -706,10 +710,10 @@ int cmd_config(int argc, const char **argv, const char *prefix)
&given_config_source,
&config_options) < 0) {
if (given_config_source.file)
die_errno("unable to read config file '%s'",
die_errno(_("unable to read config file '%s'"),
given_config_source.file);
else
die("error processing config file(s)");
die(_("error processing config file(s)"));
}
}
else if (actions == ACTION_EDIT) {
@@ -717,11 +721,11 @@ int cmd_config(int argc, const char **argv, const char *prefix)

check_argc(argc, 0, 0);
if (!given_config_source.file && nongit)
die("not in a git directory");
die(_("not in a git directory"));
if (given_config_source.use_stdin)
die("editing stdin is not supported");
die(_("editing stdin is not supported"));
if (given_config_source.blob)
die("editing blobs is not supported");
die(_("editing blobs is not supported"));
git_config(git_default_config, NULL);
config_file = given_config_source.file ?
xstrdup(given_config_source.file) :
@@ -822,7 +826,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
if (ret < 0)
return ret;
if (ret == 0)
die("No such section!");
die(_("no such section: %s"), argv[0]);
}
else if (actions == ACTION_REMOVE_SECTION) {
int ret;
@@ -833,7 +837,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
if (ret < 0)
return ret;
if (ret == 0)
die("No such section!");
die(_("no such section: %s"), argv[0]);
}
else if (actions == ACTION_GET_COLOR) {
check_argc(argc, 1, 2);

+ 21
- 21
builtin/fast-export.c View File

@@ -241,7 +241,7 @@ static void export_blob(const struct object_id *oid)
} 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(the_repository, oid, type,
@@ -255,7 +255,7 @@ static void export_blob(const struct object_id *oid)

printf("blob\nmark :%"PRIu32"\ndata %lu\n", last_idnum, size);
if (size && fwrite(buf, size, 1, stdout) != 1)
die_errno ("Could not write blob '%s'", oid_to_hex(oid));
die_errno("could not write blob '%s'", oid_to_hex(oid));
printf("\n");

show_progress();
@@ -563,14 +563,14 @@ static void handle_commit(struct commit *commit, struct rev_info *rev,
commit_buffer = get_commit_buffer(commit, NULL);
author = strstr(commit_buffer, "\nauthor ");
if (!author)
die ("Could not find author in commit %s",
oid_to_hex(&commit->object.oid));
die("could not find author in commit %s",
oid_to_hex(&commit->object.oid));
author++;
author_end = strchrnul(author, '\n');
committer = strstr(author_end, "\ncommitter ");
if (!committer)
die ("Could not find committer in commit %s",
oid_to_hex(&commit->object.oid));
die("could not find committer in commit %s",
oid_to_hex(&commit->object.oid));
committer++;
committer_end = strchrnul(committer, '\n');
message = strstr(committer_end, "\n\n");
@@ -691,7 +691,7 @@ static void handle_tag(const char *name, struct tag *tag)

buf = read_object_file(&tag->object.oid, &type, &size);
if (!buf)
die ("Could not read tag %s", oid_to_hex(&tag->object.oid));
die("could not read tag %s", oid_to_hex(&tag->object.oid));
message = memmem(buf, size, "\n\n", 2);
if (message) {
message += 2;
@@ -728,18 +728,18 @@ static void handle_tag(const char *name, struct tag *tag)
if (signature)
switch(signed_tag_mode) {
case ABORT:
die ("Encountered signed tag %s; use "
"--signed-tags=<mode> to handle it.",
oid_to_hex(&tag->object.oid));
die("encountered signed tag %s; use "
"--signed-tags=<mode> to handle it",
oid_to_hex(&tag->object.oid));
case WARN:
warning ("Exporting signed tag %s",
oid_to_hex(&tag->object.oid));
warning("exporting signed tag %s",
oid_to_hex(&tag->object.oid));
/* fallthru */
case VERBATIM:
break;
case WARN_STRIP:
warning ("Stripping signature from tag %s",
oid_to_hex(&tag->object.oid));
warning("stripping signature from tag %s",
oid_to_hex(&tag->object.oid));
/* fallthru */
case STRIP:
message_size = signature + 1 - message;
@@ -753,18 +753,18 @@ static void handle_tag(const char *name, struct tag *tag)
if (!tagged_mark) {
switch(tag_of_filtered_mode) {
case ABORT:
die ("Tag %s tags unexported object; use "
"--tag-of-filtered-object=<mode> to handle it.",
oid_to_hex(&tag->object.oid));
die("tag %s tags unexported object; use "
"--tag-of-filtered-object=<mode> to handle it",
oid_to_hex(&tag->object.oid));
case DROP:
/* Ignore this tag altogether */
free(buf);
return;
case REWRITE:
if (tagged->type != OBJ_COMMIT) {
die ("Tag %s tags unexported %s!",
oid_to_hex(&tag->object.oid),
type_name(tagged->type));
die("tag %s tags unexported %s!",
oid_to_hex(&tag->object.oid),
type_name(tagged->type));
}
p = (struct commit *)tagged;
for (;;) {
@@ -775,7 +775,7 @@ static void handle_tag(const char *name, struct tag *tag)
if (!(p->object.flags & TREESAME))
break;
if (!p->parents)
die ("Can't find replacement commit for tag %s\n",
die("can't find replacement commit for tag %s",
oid_to_hex(&tag->object.oid));
p = p->parents->item;
}

+ 1
- 1
builtin/fmt-merge-msg.c View File

@@ -628,7 +628,7 @@ int fmt_merge_msg(struct strbuf *in, struct strbuf *out,
i++;
p[len] = 0;
if (handle_line(p, &merge_parents))
die ("Error in line %d: %.*s", i, len, p);
die("error in line %d: %.*s", i, len, p);
}

if (opts->add_title && srcs.nr)

+ 6
- 6
builtin/grep.c View File

@@ -489,7 +489,7 @@ static int grep_cache(struct grep_opt *opt, struct repository *repo,
}

if (repo_read_index(repo) < 0)
die("index file corrupt");
die(_("index file corrupt"));

for (nr = 0; nr < repo->index->cache_nr; nr++) {
const struct cache_entry *ce = repo->index->cache[nr];
@@ -963,7 +963,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
}

if (!opt.pattern_list)
die(_("no pattern given."));
die(_("no pattern given"));

/* --only-matching has no effect with --invert. */
if (opt.invert)
@@ -1093,19 +1093,19 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
}

if (recurse_submodules && (!use_index || untracked))
die(_("option not supported with --recurse-submodules."));
die(_("option not supported with --recurse-submodules"));

if (!show_in_pager && !opt.status_only)
setup_pager();

if (!use_index && (untracked || cached))
die(_("--cached or --untracked cannot be used with --no-index."));
die(_("--cached or --untracked cannot be used with --no-index"));

if (!use_index || untracked) {
int use_exclude = (opt_exclude < 0) ? use_index : !!opt_exclude;
hit = grep_directory(&opt, &pathspec, use_exclude, use_index);
} else if (0 <= opt_exclude) {
die(_("--[no-]exclude-standard cannot be used for tracked contents."));
die(_("--[no-]exclude-standard cannot be used for tracked contents"));
} else if (!list.nr) {
if (!cached)
setup_work_tree();
@@ -1113,7 +1113,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
hit = grep_cache(&opt, the_repository, &pathspec, cached);
} else {
if (cached)
die(_("both --cached and trees are given."));
die(_("both --cached and trees are given"));

hit = grep_objects(&opt, &pathspec, &list);
}

+ 3
- 3
builtin/log.c View File

@@ -1608,14 +1608,14 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
numbered = 0;

if (numbered && keep_subject)
die (_("-n and -k are mutually exclusive."));
die(_("-n and -k are mutually exclusive"));
if (keep_subject && subject_prefix)
die (_("--subject-prefix/--rfc and -k are mutually exclusive."));
die(_("--subject-prefix/--rfc and -k are mutually exclusive"));
rev.preserve_subject = keep_subject;

argc = setup_revisions(argc, argv, &rev, &s_r_opt);
if (argc > 1)
die (_("unrecognized argument: %s"), argv[1]);
die(_("unrecognized argument: %s"), argv[1]);

if (rev.diffopt.output_format & DIFF_FORMAT_NAME)
die(_("--name-only does not make sense"));

+ 1
- 1
builtin/merge.c View File

@@ -725,7 +725,7 @@ static int try_merge_strategy(const char *strategy, struct commit_list *common,
exit(128);
if (write_locked_index(&the_index, &lock,
COMMIT_LOCK | SKIP_IF_UNCHANGED))
die (_("unable to write %s"), get_index_file());
die(_("unable to write %s"), get_index_file());
return clean ? 0 : 1;
} else {
return try_merge_command(strategy, xopts_nr, xopts,

+ 61
- 54
builtin/pack-objects.c View File

@@ -140,7 +140,7 @@ static void *get_delta(struct object_entry *entry)

buf = read_object_file(&entry->idx.oid, &type, &size);
if (!buf)
die("unable to read %s", oid_to_hex(&entry->idx.oid));
die(_("unable to read %s"), oid_to_hex(&entry->idx.oid));
base_buf = read_object_file(&DELTA(entry)->idx.oid, &type,
&base_size);
if (!base_buf)
@@ -148,8 +148,13 @@ static void *get_delta(struct object_entry *entry)
oid_to_hex(&DELTA(entry)->idx.oid));
delta_buf = diff_delta(base_buf, base_size,
buf, size, &delta_size, 0);
/*
* We succesfully computed this delta once but dropped it for
* memory reasons. Something is very wrong if this time we
* recompute and create a different delta.
*/
if (!delta_buf || delta_size != DELTA_SIZE(entry))
die("delta size changed");
BUG("delta size changed");
free(buf);
free(base_buf);
return delta_buf;
@@ -406,7 +411,7 @@ static off_t write_reuse_object(struct hashfile *f, struct object_entry *entry,
datalen = revidx[1].offset - offset;
if (!pack_to_stdout && p->index_version > 1 &&
check_pack_crc(p, &w_curs, offset, datalen, revidx->nr)) {
error("bad packed object CRC for %s",
error(_("bad packed object CRC for %s"),
oid_to_hex(&entry->idx.oid));
unuse_pack(&w_curs);
return write_no_reuse_object(f, entry, limit, usable_delta);
@@ -417,7 +422,7 @@ static off_t write_reuse_object(struct hashfile *f, struct object_entry *entry,

if (!pack_to_stdout && p->index_version == 1 &&
check_pack_inflate(p, &w_curs, offset, datalen, entry_size)) {
error("corrupt packed object for %s",
error(_("corrupt packed object for %s"),
oid_to_hex(&entry->idx.oid));
unuse_pack(&w_curs);
return write_no_reuse_object(f, entry, limit, usable_delta);
@@ -548,7 +553,7 @@ static enum write_one_status write_one(struct hashfile *f,
*/
recursing = (e->idx.offset == 1);
if (recursing) {
warning("recursive delta detected for object %s",
warning(_("recursive delta detected for object %s"),
oid_to_hex(&e->idx.oid));
return WRITE_ONE_RECURSIVE;
} else if (e->idx.offset || e->preferred_base) {
@@ -582,7 +587,7 @@ static enum write_one_status write_one(struct hashfile *f,

/* make sure off_t is sufficiently large not to wrap */
if (signed_add_overflows(*offset, size))
die("pack too large for current definition of off_t");
die(_("pack too large for current definition of off_t"));
*offset += size;
return WRITE_ONE_WRITTEN;
}
@@ -748,7 +753,8 @@ static struct object_entry **compute_write_order(void)
}

if (wo_end != to_pack.nr_objects)
die("ordered %u objects, expected %"PRIu32, wo_end, to_pack.nr_objects);
die(_("ordered %u objects, expected %"PRIu32),
wo_end, to_pack.nr_objects);

return wo;
}
@@ -760,15 +766,15 @@ static off_t write_reused_pack(struct hashfile *f)
int fd;

if (!is_pack_valid(reuse_packfile))
die("packfile is invalid: %s", reuse_packfile->pack_name);
die(_("packfile is invalid: %s"), reuse_packfile->pack_name);

fd = git_open(reuse_packfile->pack_name);
if (fd < 0)
die_errno("unable to open packfile for reuse: %s",
die_errno(_("unable to open packfile for reuse: %s"),
reuse_packfile->pack_name);

if (lseek(fd, sizeof(struct pack_header), SEEK_SET) == -1)
die_errno("unable to seek in reused packfile");
die_errno(_("unable to seek in reused packfile"));

if (reuse_packfile_offset < 0)
reuse_packfile_offset = reuse_packfile->pack_size - the_hash_algo->rawsz;
@@ -779,7 +785,7 @@ static off_t write_reused_pack(struct hashfile *f)
int read_pack = xread(fd, buffer, sizeof(buffer));

if (read_pack <= 0)
die_errno("unable to read from reused packfile");
die_errno(_("unable to read from reused packfile"));

if (read_pack > to_write)
read_pack = to_write;
@@ -882,7 +888,7 @@ static void write_pack_file(void)
* to preserve this property.
*/
if (stat(pack_tmp_name, &st) < 0) {
warning_errno("failed to stat %s", pack_tmp_name);
warning_errno(_("failed to stat %s"), pack_tmp_name);
} else if (!last_mtime) {
last_mtime = st.st_mtime;
} else {
@@ -890,7 +896,7 @@ static void write_pack_file(void)
utb.actime = st.st_atime;
utb.modtime = --last_mtime;
if (utime(pack_tmp_name, &utb) < 0)
warning_errno("failed utime() on %s", pack_tmp_name);
warning_errno(_("failed utime() on %s"), pack_tmp_name);
}

strbuf_addf(&tmpname, "%s-", base_name);
@@ -935,8 +941,8 @@ static void write_pack_file(void)
free(write_order);
stop_progress(&progress_state);
if (written != nr_result)
die("wrote %"PRIu32" objects while expecting %"PRIu32,
written, nr_result);
die(_("wrote %"PRIu32" objects while expecting %"PRIu32),
written, nr_result);
}

static int no_try_delta(const char *path)
@@ -1480,7 +1486,7 @@ static void check_object(struct object_entry *entry)
while (c & 128) {
ofs += 1;
if (!ofs || MSB(ofs, 7)) {
error("delta base offset overflow in pack for %s",
error(_("delta base offset overflow in pack for %s"),
oid_to_hex(&entry->idx.oid));
goto give_up;
}
@@ -1489,7 +1495,7 @@ static void check_object(struct object_entry *entry)
}
ofs = entry->in_pack_offset - ofs;
if (ofs <= 0 || ofs >= entry->in_pack_offset) {
error("delta base offset out of bound for %s",
error(_("delta base offset out of bound for %s"),
oid_to_hex(&entry->idx.oid));
goto give_up;
}
@@ -1974,10 +1980,10 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
trg->data = read_object_file(&trg_entry->idx.oid, &type, &sz);
read_unlock();
if (!trg->data)
die("object %s cannot be read",
die(_("object %s cannot be read"),
oid_to_hex(&trg_entry->idx.oid));
if (sz != trg_size)
die("object %s inconsistent object length (%lu vs %lu)",
die(_("object %s inconsistent object length (%lu vs %lu)"),
oid_to_hex(&trg_entry->idx.oid), sz,
trg_size);
*mem_usage += sz;
@@ -1990,7 +1996,7 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
if (src_entry->preferred_base) {
static int warned = 0;
if (!warned++)
warning("object %s cannot be read",
warning(_("object %s cannot be read"),
oid_to_hex(&src_entry->idx.oid));
/*
* Those objects are not included in the
@@ -2000,11 +2006,11 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
*/
return 0;
}
die("object %s cannot be read",
die(_("object %s cannot be read"),
oid_to_hex(&src_entry->idx.oid));
}
if (sz != src_size)
die("object %s inconsistent object length (%lu vs %lu)",
die(_("object %s inconsistent object length (%lu vs %lu)"),
oid_to_hex(&src_entry->idx.oid), sz,
src_size);
*mem_usage += sz;
@@ -2014,7 +2020,7 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
if (!src->index) {
static int warned = 0;
if (!warned++)
warning("suboptimal pack - out of memory");
warning(_("suboptimal pack - out of memory"));
return 0;
}
*mem_usage += sizeof_delta_index(src->index);
@@ -2341,8 +2347,8 @@ static void ll_find_deltas(struct object_entry **list, unsigned list_size,
return;
}
if (progress > pack_to_stdout)
fprintf(stderr, "Delta compression using up to %d threads.\n",
delta_search_threads);
fprintf_ln(stderr, _("Delta compression using up to %d threads"),
delta_search_threads);
p = xcalloc(delta_search_threads, sizeof(*p));

/* Partition the work amongst work threads. */
@@ -2382,7 +2388,7 @@ static void ll_find_deltas(struct object_entry **list, unsigned list_size,
ret = pthread_create(&p[i].thread, NULL,
threaded_find_deltas, &p[i]);
if (ret)
die("unable to create thread: %s", strerror(ret));
die(_("unable to create thread: %s"), strerror(ret));
active_threads++;
}

@@ -2477,7 +2483,7 @@ static void add_tag_chain(const struct object_id *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);
@@ -2543,7 +2549,7 @@ static void prepare_pack(int window, int depth)
if (!entry->preferred_base) {
nr_deltas++;
if (oe_type(entry) < 0)
die("unable to get type of object %s",
die(_("unable to get type of object %s"),
oid_to_hex(&entry->idx.oid));
} else {
if (oe_type(entry) < 0) {
@@ -2567,7 +2573,7 @@ static void prepare_pack(int window, int depth)
ll_find_deltas(delta_list, n, window+1, depth, &nr_done);
stop_progress(&progress_state);
if (nr_done != nr_deltas)
die("inconsistency with delta count");
die(_("inconsistency with delta count"));
}
free(delta_list);
}
@@ -2607,11 +2613,11 @@ static int git_pack_config(const char *k, const char *v, void *cb)
if (!strcmp(k, "pack.threads")) {
delta_search_threads = git_config_int(k, v);
if (delta_search_threads < 0)
die("invalid number of threads specified (%d)",
die(_("invalid number of threads specified (%d)"),
delta_search_threads);
#ifdef NO_PTHREADS
if (delta_search_threads != 1) {
warning("no threads support, ignoring %s", k);
warning(_("no threads support, ignoring %s"), k);
delta_search_threads = 0;
}
#endif
@@ -2620,7 +2626,7 @@ static int git_pack_config(const char *k, const char *v, void *cb)
if (!strcmp(k, "pack.indexversion")) {
pack_idx_opts.version = git_config_int(k, v);
if (pack_idx_opts.version > 2)
die("bad pack.indexversion=%"PRIu32,
die(_("bad pack.indexversion=%"PRIu32),
pack_idx_opts.version);
return 0;
}
@@ -2638,7 +2644,7 @@ static void read_object_list_from_stdin(void)
if (feof(stdin))
break;
if (!ferror(stdin))
die("fgets returned NULL, not EOF, not error!");
die("BUG: fgets returned NULL, not EOF, not error!");
if (errno != EINTR)
die_errno("fgets");
clearerr(stdin);
@@ -2646,13 +2652,13 @@ static void read_object_list_from_stdin(void)
}
if (line[0] == '-') {
if (get_oid_hex(line+1, &oid))
die("expected edge object ID, got garbage:\n %s",
die(_("expected edge object ID, got garbage:\n %s"),
line);
add_preferred_base(&oid);
continue;
}
if (parse_oid_hex(line, &oid, &p))
die("expected object ID, got garbage:\n %s", line);
die(_("expected object ID, got garbage:\n %s"), line);

add_preferred_base_object(p + 1);
add_object_entry(&oid, OBJ_NONE, p + 1, 0);
@@ -2791,7 +2797,7 @@ static void add_objects_in_unpacked_packs(struct rev_info *revs)
if (!p->pack_local || p->pack_keep || p->pack_keep_in_core)
continue;
if (open_pack_index(p))
die("cannot open pack index");
die(_("cannot open pack index"));

ALLOC_GROW(in_pack.array,
in_pack.nr + p->num_objects,
@@ -2822,7 +2828,7 @@ static int add_loose_object(const struct object_id *oid, const char *path,
enum object_type type = oid_object_info(the_repository, oid, NULL);

if (type < 0) {
warning("loose object at %s could not be examined", path);
warning(_("loose object at %s could not be examined"), path);
return 0;
}

@@ -2899,7 +2905,7 @@ static void loosen_unused_packed_objects(struct rev_info *revs)
continue;

if (open_pack_index(p))
die("cannot open pack index");
die(_("cannot open pack index"));

for (i = 0; i < p->num_objects; i++) {
nth_packed_object_oid(&oid, p, i);
@@ -2907,7 +2913,7 @@ static void loosen_unused_packed_objects(struct rev_info *revs)
!has_sha1_pack_kept_or_nonlocal(&oid) &&
!loosened_object_can_be_discarded(&oid, p->mtime))
if (force_object_loose(&oid, p->mtime))
die("unable to force loose object");
die(_("unable to force loose object"));
}
}
}
@@ -2994,17 +3000,17 @@ static void get_object_list(int ac, const char **av)
use_bitmap_index = 0;
continue;
}
die("not a rev '%s'", line);
die(_("not a rev '%s'"), line);
}
if (handle_revision_arg(line, &revs, flags, REVARG_CANNOT_BE_FILENAME))
die("bad revision '%s'", line);
die(_("bad revision '%s'"), line);
}

if (use_bitmap_index && !get_object_list_from_bitmap(&revs))
return;

if (prepare_revision_walk(&revs))
die("revision walk setup failed");
die(_("revision walk setup failed"));
mark_edges_uninteresting(&revs, show_edge);

if (!fn_show_object)
@@ -3017,9 +3023,9 @@ static void get_object_list(int ac, const char **av)
revs.ignore_missing_links = 1;
if (add_unseen_recent_objects_to_traversal(&revs,
unpack_unreachable_expiration))
die("unable to add recent objects");
die(_("unable to add recent objects"));
if (prepare_revision_walk(&revs))
die("revision walk setup failed");
die(_("revision walk setup failed"));
traverse_commit_list(&revs, record_recent_commit,
record_recent_object, NULL);
}
@@ -3254,35 +3260,35 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
if (pack_compression_level == -1)
pack_compression_level = Z_DEFAULT_COMPRESSION;
else if (pack_compression_level < 0 || pack_compression_level > Z_BEST_COMPRESSION)
die("bad pack compression level %d", pack_compression_level);
die(_("bad pack compression level %d"), pack_compression_level);

if (!delta_search_threads) /* --threads=0 means autodetect */
delta_search_threads = online_cpus();

#ifdef NO_PTHREADS
if (delta_search_threads != 1)
warning("no threads support, ignoring --threads");
warning(_("no threads support, ignoring --threads"));
#endif
if (!pack_to_stdout && !pack_size_limit)
pack_size_limit = pack_size_limit_cfg;
if (pack_to_stdout && pack_size_limit)
die("--max-pack-size cannot be used to build a pack for transfer.");
die(_("--max-pack-size cannot be used to build a pack for transfer"));
if (pack_size_limit && pack_size_limit < 1024*1024) {
warning("minimum pack size limit is 1 MiB");
warning(_("minimum pack size limit is 1 MiB"));
pack_size_limit = 1024*1024;
}

if (!pack_to_stdout && thin)
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)
die("--keep-unreachable and --unpack-unreachable are incompatible.");
die(_("--keep-unreachable and --unpack-unreachable are incompatible"));
if (!rev_list_all || !rev_list_reflog || !rev_list_index)
unpack_unreachable_expiration = 0;

if (filter_options.choice) {
if (!pack_to_stdout)
die("cannot use --filter without --stdout.");
die(_("cannot use --filter without --stdout"));
use_bitmap_index = 0;
}

@@ -3356,8 +3362,9 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
prepare_pack(window, depth);
write_pack_file();
if (progress)
fprintf(stderr, "Total %"PRIu32" (delta %"PRIu32"),"
" reused %"PRIu32" (delta %"PRIu32")\n",
written, written_delta, reused, reused_delta);
fprintf_ln(stderr,
_("Total %"PRIu32" (delta %"PRIu32"),"
" reused %"PRIu32" (delta %"PRIu32")"),
written, written_delta, reused, reused_delta);
return 0;
}

+ 42
- 42
builtin/replace.c View File

@@ -54,7 +54,7 @@ static int show_reference(const char *refname, const struct object_id *oid,
enum object_type obj_type, repl_type;

if (get_oid(refname, &object))
return error("Failed to resolve '%s' as a valid ref.", refname);
return error(_("failed to resolve '%s' as a valid ref"), refname);

obj_type = oid_object_info(the_repository, &object,
NULL);
@@ -83,8 +83,8 @@ static int list_replace_refs(const char *pattern, const char *format)
else if (!strcmp(format, "long"))
data.format = REPLACE_FORMAT_LONG;
else
return error("invalid replace format '%s'\n"
"valid formats are 'short', 'medium' and 'long'\n",
return error(_("invalid replace format '%s'\n"
"valid formats are 'short', 'medium' and 'long'"),
format);

for_each_replace_ref(the_repository, show_reference, (void *)&data);
@@ -108,7 +108,7 @@ static int for_each_replace_name(const char **argv, each_replace_name_fn fn)

for (p = argv; *p; p++) {
if (get_oid(*p, &oid)) {
error("Failed to resolve '%s' as a valid ref.", *p);
error("failed to resolve '%s' as a valid ref", *p);
had_error = 1;
continue;
}
@@ -118,7 +118,7 @@ static int for_each_replace_name(const char **argv, each_replace_name_fn fn)
full_hex = ref.buf + base_len;

if (read_ref(ref.buf, &oid)) {
error("replace ref '%s' not found.", full_hex);
error(_("replace ref '%s' not found"), full_hex);
had_error = 1;
continue;
}
@@ -134,7 +134,7 @@ static int delete_replace_ref(const char *name, const char *ref,
{
if (delete_ref(NULL, ref, oid, 0))
return 1;
printf("Deleted replace ref '%s'\n", name);
printf_ln(_("Deleted replace ref '%s'"), name);
return 0;
}

@@ -146,12 +146,12 @@ static int check_ref_valid(struct object_id *object,
strbuf_reset(ref);
strbuf_addf(ref, "%s%s", git_replace_ref_base, oid_to_hex(object));
if (check_refname_format(ref->buf, 0))
return error("'%s' is not a valid ref name.", ref->buf);
return error(_("'%s' is not a valid ref name"), ref->buf);

if (read_ref(ref->buf, prev))
oidclr(prev);
else if (!force)
return error("replace ref '%s' already exists", ref->buf);
return error(_("replace ref '%s' already exists"), ref->buf);
return 0;
}

@@ -171,10 +171,10 @@ static int replace_object_oid(const char *object_ref,
obj_type = oid_object_info(the_repository, object, NULL);
repl_type = oid_object_info(the_repository, repl, NULL);
if (!force && obj_type != repl_type)
return error("Objects must be of the same type.\n"
"'%s' points to a replaced object of type '%s'\n"
"while '%s' points to a replacement object of "
"type '%s'.",
return error(_("Objects must be of the same type.\n"
"'%s' points to a replaced object of type '%s'\n"
"while '%s' points to a replacement object of "
"type '%s'."),
object_ref, type_name(obj_type),
replace_ref, type_name(repl_type));

@@ -200,10 +200,10 @@ static int replace_object(const char *object_ref, const char *replace_ref, int f
struct object_id object, repl;

if (get_oid(object_ref, &object))
return error("Failed to resolve '%s' as a valid ref.",
return error(_("failed to resolve '%s' as a valid ref"),
object_ref);
if (get_oid(replace_ref, &repl))
return error("Failed to resolve '%s' as a valid ref.",
return error(_("failed to resolve '%s' as a valid ref"),
replace_ref);

return replace_object_oid(object_ref, &object, replace_ref, &repl, force);
@@ -222,7 +222,7 @@ static int export_object(const struct object_id *oid, enum object_type type,

fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666);
if (fd < 0)
return error_errno("unable to open %s for writing", filename);
return error_errno(_("unable to open %s for writing"), filename);

argv_array_push(&cmd.args, "--no-replace-objects");
argv_array_push(&cmd.args, "cat-file");
@@ -235,7 +235,7 @@ static int export_object(const struct object_id *oid, enum object_type type,
cmd.out = fd;

if (run_command(&cmd))
return error("cat-file reported failure");
return error(_("cat-file reported failure"));
return 0;
}

@@ -251,7 +251,7 @@ static int import_object(struct object_id *oid, enum object_type type,

fd = open(filename, O_RDONLY);
if (fd < 0)
return error_errno("unable to open %s for reading", filename);
return error_errno(_("unable to open %s for reading"), filename);

if (!raw && type == OBJ_TREE) {
const char *argv[] = { "mktree", NULL };
@@ -265,11 +265,11 @@ static int import_object(struct object_id *oid, enum object_type type,

if (start_command(&cmd)) {
close(fd);
return error("unable to spawn mktree");
return error(_("unable to spawn mktree"));
}

if (strbuf_read(&result, cmd.out, 41) < 0) {
error_errno("unable to read from mktree");
error_errno(_("unable to read from mktree"));
close(fd);
close(cmd.out);
return -1;
@@ -278,11 +278,11 @@ static int import_object(struct object_id *oid, enum object_type type,

if (finish_command(&cmd)) {
strbuf_release(&result);
return error("mktree reported failure");
return error(_("mktree reported failure"));
}
if (get_oid_hex(result.buf, oid) < 0) {
strbuf_release(&result);
return error("mktree did not return an object name");
return error(_("mktree did not return an object name"));
}

strbuf_release(&result);
@@ -291,12 +291,12 @@ static int import_object(struct object_id *oid, enum object_type type,
int flags = HASH_FORMAT_CHECK | HASH_WRITE_OBJECT;

if (fstat(fd, &st) < 0) {
error_errno("unable to fstat %s", filename);
error_errno(_("unable to fstat %s"), filename);
close(fd);
return -1;
}
if (index_fd(oid, fd, &st, type, NULL, flags) < 0)
return error("unable to write object to database");
return error(_("unable to write object to database"));
/* index_fd close()s fd for us */
}

@@ -315,11 +315,11 @@ static int edit_and_replace(const char *object_ref, int force, int raw)
struct strbuf ref = STRBUF_INIT;

if (get_oid(object_ref, &old_oid) < 0)
return error("Not a valid object name: '%s'", object_ref);
return error(_("not a valid object name: '%s'"), object_ref);

type = oid_object_info(the_repository, &old_oid, NULL);
if (type < 0)
return error("unable to get object type for %s",
return error(_("unable to get object type for %s"),
oid_to_hex(&old_oid));

if (check_ref_valid(&old_oid, &prev, &ref, force)) {
@@ -335,7 +335,7 @@ static int edit_and_replace(const char *object_ref, int force, int raw)
}
if (launch_editor(tmpfile, NULL, NULL) < 0) {
free(tmpfile);
return error("editing object file failed");
return error(_("editing object file failed"));
}
if (import_object(&new_oid, type, raw, tmpfile)) {
free(tmpfile);
@@ -344,7 +344,7 @@ static int edit_and_replace(const char *object_ref, int force, int raw)
free(tmpfile);

if (!oidcmp(&old_oid, &new_oid))
return error("new object is the same as the old one: '%s'", oid_to_hex(&old_oid));
return error(_("new object is the same as the old one: '%s'"), oid_to_hex(&old_oid));

return replace_object_oid(object_ref, &old_oid, "replacement", &new_oid, force);
}
@@ -368,7 +368,7 @@ static int replace_parents(struct strbuf *buf, int argc, const char **argv)
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(the_repository, &oid)) {
@@ -412,7 +412,7 @@ static int check_one_mergetag(struct commit *commit,
for (i = 1; i < mergetag_data->argc; i++) {
struct object_id oid;
if (get_oid(mergetag_data->argv[i], &oid) < 0)
return error(_("Not a valid object name: '%s'"),
return error(_("not a valid object name: '%s'"),
mergetag_data->argv[i]);
if (!oidcmp(&tag->tagged->oid, &oid))
return 0; /* found */
@@ -442,7 +442,7 @@ static int create_graft(int argc, const char **argv, int force, int gentle)
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(the_repository, &old_oid);
if (!commit)
return error(_("could not parse %s"), old_ref);
@@ -457,7 +457,7 @@ static int create_graft(int argc, const char **argv, int force, int gentle)
}

if (remove_signature(&buf)) {
warning(_("the original commit '%s' has a gpg signature."), old_ref);
warning(_("the original commit '%s' has a gpg signature"), old_ref);
warning(_("the signature will be removed in the replacement commit!"));
}

@@ -476,10 +476,10 @@ static int create_graft(int argc, const char **argv, int force, int gentle)

if (!oidcmp(&old_oid, &new_oid)) {
if (gentle) {
warning("graft for '%s' unnecessary", oid_to_hex(&old_oid));
warning(_("graft for '%s' unnecessary"), oid_to_hex(&old_oid));
return 0;
}
return error("new commit is the same as the old one: '%s'", oid_to_hex(&old_oid));
return error(_("new commit is the same as the old one: '%s'"), oid_to_hex(&old_oid));
}

return replace_object_oid(old_ref, &old_oid, "replacement", &new_oid, force);
@@ -553,7 +553,7 @@ int cmd_replace(int argc, const char **argv, const char *prefix)
cmdmode = argc ? MODE_REPLACE : MODE_LIST;

if (format && cmdmode != MODE_LIST)
usage_msg_opt("--format cannot be used when not listing",
usage_msg_opt(_("--format cannot be used when not listing"),
git_replace_usage, options);

if (force &&
@@ -561,47 +561,47 @@ int cmd_replace(int argc, const char **argv, const char *prefix)
cmdmode != MODE_EDIT &&
cmdmode != MODE_GRAFT &&
cmdmode != MODE_CONVERT_GRAFT_FILE)
usage_msg_opt("-f only makes sense when writing a replacement",
usage_msg_opt(_("-f only makes sense when writing a replacement"),
git_replace_usage, options);

if (raw && cmdmode != MODE_EDIT)
usage_msg_opt("--raw only makes sense with --edit",
usage_msg_opt(_("--raw only makes sense with --edit"),
git_replace_usage, options);

switch (cmdmode) {
case MODE_DELETE:
if (argc < 1)
usage_msg_opt("-d needs at least one argument",
usage_msg_opt(_("-d needs at least one argument"),
git_replace_usage, options);
return for_each_replace_name(argv, delete_replace_ref);

case MODE_REPLACE:
if (argc != 2)
usage_msg_opt("bad number of arguments",
usage_msg_opt(_("bad number of arguments"),
git_replace_usage, options);
return replace_object(argv[0], argv[1], force);

case MODE_EDIT:
if (argc != 1)
usage_msg_opt("-e needs exactly one argument",
usage_msg_opt(_("-e needs exactly one argument"),
git_replace_usage, options);
return edit_and_replace(argv[0], force, raw);

case MODE_GRAFT:
if (argc < 1)
usage_msg_opt("-g needs at least one argument",
usage_msg_opt(_("-g needs at least one argument"),
git_replace_usage, options);
return create_graft(argc, argv, force, 0);

case MODE_CONVERT_GRAFT_FILE:
if (argc != 0)
usage_msg_opt("--convert-graft-file takes no argument",
usage_msg_opt(_("--convert-graft-file takes no argument"),
git_replace_usage, options);
return !!convert_graft_file(force);

case MODE_LIST:
if (argc > 1)
usage_msg_opt("only one pattern can be given with -l",
usage_msg_opt(_("only one pattern can be given with -l"),
git_replace_usage, options);
return list_replace_refs(argv[0], format);


+ 1
- 1
builtin/rm.c View File

@@ -285,7 +285,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
list.entry[list.nr].is_submodule = S_ISGITLINK(ce->ce_mode);
if (list.entry[list.nr++].is_submodule &&
!is_staging_gitmodules_ok(&the_index))
die (_("Please stage your changes to .gitmodules or stash them to proceed"));
die(_("please stage your changes to .gitmodules or stash them to proceed"));
}

if (pathspec.nr) {

+ 10
- 10
commit-graph.c View File

@@ -80,28 +80,28 @@ struct commit_graph *load_commit_graph_one(const char *graph_file)

if (graph_size < GRAPH_MIN_SIZE) {
close(fd);
die("graph file %s is too small", graph_file);
die(_("graph file %s is too small"), graph_file);
}
graph_map = xmmap(NULL, graph_size, PROT_READ, MAP_PRIVATE, fd, 0);
data = (const unsigned char *)graph_map;

graph_signature = get_be32(data);
if (graph_signature != GRAPH_SIGNATURE) {
error("graph signature %X does not match signature %X",
error(_("graph signature %X does not match signature %X"),
graph_signature, GRAPH_SIGNATURE);
goto cleanup_fail;
}

graph_version = *(unsigned char*)(data + 4);
if (graph_version != GRAPH_VERSION) {
error("graph version %X does not match version %X",
error(_("graph version %X does not match version %X"),
graph_version, GRAPH_VERSION);
goto cleanup_fail;
}

hash_version = *(unsigned char*)(data + 5);
if (hash_version != GRAPH_OID_VERSION) {
error("hash version %X does not match version %X",
error(_("hash version %X does not match version %X"),
hash_version, GRAPH_OID_VERSION);
goto cleanup_fail;
}
@@ -125,7 +125,7 @@ struct commit_graph *load_commit_graph_one(const char *graph_file)
chunk_lookup += GRAPH_CHUNKLOOKUP_WIDTH;

if (chunk_offset > graph_size - GIT_MAX_RAWSZ) {
error("improper chunk offset %08x%08x", (uint32_t)(chunk_offset >> 32),
error(_("improper chunk offset %08x%08x"), (uint32_t)(chunk_offset >> 32),
(uint32_t)chunk_offset);
goto cleanup_fail;
}
@@ -161,7 +161,7 @@ struct commit_graph *load_commit_graph_one(const char *graph_file)
}

if (chunk_repeated) {
error("chunk id %08x appears multiple times", chunk_id);
error(_("chunk id %08x appears multiple times"), chunk_id);
goto cleanup_fail;
}

@@ -258,7 +258,7 @@ static struct commit_list **insert_parent_or_die(struct commit_graph *g,
hashcpy(oid.hash, g->chunk_oid_lookup + g->hash_len * pos);
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;
}
@@ -562,7 +562,7 @@ static int add_packed_commits(const struct object_id *oid,

oi.typep = &type;
if (packed_object_info(the_repository, pack, offset, &oi) < 0)
die("unable to get type of object %s", oid_to_hex(oid));
die(_("unable to get type of object %s"), oid_to_hex(oid));

if (type != OBJ_COMMIT)
return 0;
@@ -727,9 +727,9 @@ void write_commit_graph(const char *obj_dir,
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);
}

+ 36
- 36
config.c View File

@@ -117,12 +117,12 @@ static long config_buf_ftell(struct config_source *conf)
}

#define MAX_INCLUDE_DEPTH 10
static const char include_depth_advice[] =
static const char include_depth_advice[] = N_(
"exceeded maximum include depth (%d) while including\n"
" %s\n"
"from\n"
" %s\n"
"Do you have circular includes?";
"Do you have circular includes?");
static int handle_path_include(const char *path, struct config_include_data *inc)
{
int ret = 0;
@@ -134,7 +134,7 @@ static int handle_path_include(const char *path, struct config_include_data *inc

expanded = expand_user_path(path, 0);
if (!expanded)
return error("could not expand include path '%s'", path);
return error(_("could not expand include path '%s'"), path);
path = expanded;

/*
@@ -145,7 +145,7 @@ static int handle_path_include(const char *path, struct config_include_data *inc
char *slash;

if (!cf || !cf->path)
return error("relative config includes must come from files");
return error(_("relative config includes must come from files"));

slash = find_last_dir_sep(cf->path);
if (slash)
@@ -156,7 +156,7 @@ static int handle_path_include(const char *path, struct config_include_data *inc

if (!access_or_die(path, R_OK, 0)) {
if (++inc->depth > MAX_INCLUDE_DEPTH)
die(include_depth_advice, MAX_INCLUDE_DEPTH, path,
die(_(include_depth_advice), MAX_INCLUDE_DEPTH, path,
!cf ? "<unknown>" :
cf->name ? cf->name :
"the command line");
@@ -343,13 +343,13 @@ static int git_config_parse_key_1(const char *key, char **store_key, int *basele

if (last_dot == NULL || last_dot == key) {
if (!quiet)
error("key does not contain a section: %s", key);
error(_("key does not contain a section: %s"), key);
return -CONFIG_NO_SECTION_OR_NAME;
}

if (!last_dot[1]) {
if (!quiet)
error("key does not contain variable name: %s", key);
error(_("key does not contain variable name: %s"), key);
return -CONFIG_NO_SECTION_OR_NAME;
}

@@ -373,13 +373,13 @@ static int git_config_parse_key_1(const char *key, char **store_key, int *basele
if (!iskeychar(c) ||
(i == baselen + 1 && !isalpha(c))) {
if (!quiet)
error("invalid key: %s", key);
error(_("invalid key: %s"), key);
goto out_free_ret_1;
}
c = tolower(c);
} else if (c == '\n') {
if (!quiet)
error("invalid key (newline): %s", key);
error(_("invalid key (newline): %s"), key);
goto out_free_ret_1;
}
if (store_key)
@@ -415,7 +415,7 @@ int git_config_parse_parameter(const char *text,

pair = strbuf_split_str(text, '=', 2);
if (!pair[0])
return error("bogus config parameter: %s", text);
return error(_("bogus config parameter: %s"), text);

if (pair[0]->len && pair[0]->buf[pair[0]->len - 1] == '=') {
strbuf_setlen(pair[0], pair[0]->len - 1);
@@ -427,7 +427,7 @@ int git_config_parse_parameter(const char *text,
strbuf_trim(pair[0]);
if (!pair[0]->len) {
strbuf_list_free(pair);
return error("bogus config parameter: %s", text);
return error(_("bogus config parameter: %s"), text);
}

if (git_config_parse_key(pair[0]->buf, &canonical_name, NULL)) {
@@ -462,7 +462,7 @@ int git_config_from_parameters(config_fn_t fn, void *data)
envw = xstrdup(env);

if (sq_dequote_to_argv(envw, &argv, &nr, &alloc) < 0) {
ret = error("bogus format in " CONFIG_DATA_ENVIRONMENT);
ret = error(_("bogus format in %s"), CONFIG_DATA_ENVIRONMENT);
goto out;
}

@@ -1166,7 +1166,7 @@ static int git_default_core_config(const char *var, const char *value)
else {
int abbrev = git_config_int(var, value);
if (abbrev < minimum_abbrev || abbrev > 40)
return error("abbrev length out of range: %d", abbrev);
return error(_("abbrev length out of range: %d"), abbrev);
default_abbrev = abbrev;
}
return 0;
@@ -1283,7 +1283,7 @@ static int git_default_core_config(const char *var, const char *value)
comment_line_char = value[0];
auto_comment_line_char = 0;
} else
return error("core.commentChar should only be one character");
return error(_("core.commentChar should only be one character"));
return 0;
}

@@ -1396,7 +1396,7 @@ static int git_default_branch_config(const char *var, const char *value)
else if (!strcmp(value, "always"))
autorebase = AUTOREBASE_ALWAYS;
else
return error("malformed value for %s", var);
return error(_("malformed value for %s"), var);
return 0;
}

@@ -1422,9 +1422,9 @@ static int git_default_push_config(const char *var, const char *value)
else if (!strcmp(value, "current"))
push_default = PUSH_DEFAULT_CURRENT;
else {
error("malformed value for %s: %s", var, value);
return error("Must be one of nothing, matching, simple, "
"upstream or current.");
error(_("malformed value for %s: %s"), var, value);
return error(_("must be one of nothing, matching, simple, "
"upstream or current"));
}
return 0;
}
@@ -1603,10 +1603,10 @@ int git_config_from_blob_oid(config_fn_t 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,
@@ -1623,7 +1623,7 @@ static int git_config_from_blob_ref(config_fn_t fn,
struct object_id oid;

if (get_oid(name, &oid) < 0)
return error("unable to resolve config blob '%s'", name);
return error(_("unable to resolve config blob '%s'"), name);
return git_config_from_blob_oid(fn, name, &oid, data);
}

@@ -1653,7 +1653,7 @@ unsigned long git_env_ulong(const char *k, unsigned long val)
{
const char *v = getenv(k);
if (v && !git_parse_ulong(v, &val))
die("failed to parse %s", k);
die(_("failed to parse %s"), k);
return val;
}

@@ -2370,7 +2370,7 @@ static int store_aux_event(enum config_event_t type,

if (type == CONFIG_EVENT_SECTION) {
if (cf->var.len < 2 || cf->var.buf[cf->var.len - 1] != '.')
return error("invalid section name '%s'", cf->var.buf);
return error(_("invalid section name '%s'"), cf->var.buf);

/* Is this the section we were looking for? */
store->is_keys_section =
@@ -2426,7 +2426,7 @@ static int store_aux(const char *key, const char *value, void *cb)

static int write_error(const char *filename)
{
error("failed to write new configuration file %s", filename);
error(_("failed to write new configuration file %s"), filename);

/* Same error code as "failed to rename". */
return 4;
@@ -2677,7 +2677,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
*/
fd = hold_lock_file_for_update(&lock, config_filename, 0);
if (fd < 0) {
error_errno("could not lock config file %s", config_filename);
error_errno(_("could not lock config file %s"), config_filename);
ret = CONFIG_NO_LOCK;
goto out_free;
}
@@ -2688,7 +2688,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
in_fd = open(config_filename, O_RDONLY);
if ( in_fd < 0 ) {
if ( ENOENT != errno ) {
error_errno("opening %s", config_filename);
error_errno(_("opening %s"), config_filename);
ret = CONFIG_INVALID_FILE; /* same as "invalid config file" */
goto out_free;
}
@@ -2723,7 +2723,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
store.value_regex = (regex_t*)xmalloc(sizeof(regex_t));
if (regcomp(store.value_regex, value_regex,
REG_EXTENDED)) {
error("invalid pattern: %s", value_regex);
error(_("invalid pattern: %s"), value_regex);
FREE_AND_NULL(store.value_regex);
ret = CONFIG_INVALID_PATTERN;
goto out_free;
@@ -2748,7 +2748,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
if (git_config_from_file_with_options(store_aux,
config_filename,
&store, &opts)) {
error("invalid config file %s", config_filename);
error(_("invalid config file %s"), config_filename);
ret = CONFIG_INVALID_FILE;
goto out_free;
}
@@ -2772,7 +2772,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
if (contents == MAP_FAILED) {
if (errno == ENODEV && S_ISDIR(st.st_mode))
errno = EISDIR;
error_errno("unable to mmap '%s'", config_filename);
error_errno(_("unable to mmap '%s'"), config_filename);
ret = CONFIG_INVALID_FILE;
contents = NULL;
goto out_free;
@@ -2781,7 +2781,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
in_fd = -1;

if (chmod(get_lock_file_path(&lock), st.st_mode & 07777) < 0) {
error_errno("chmod on %s failed", get_lock_file_path(&lock));
error_errno(_("chmod on %s failed"), get_lock_file_path(&lock));
ret = CONFIG_NO_WRITE;
goto out_free;
}
@@ -2866,7 +2866,7 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
}

if (commit_lock_file(&lock) < 0) {
error_errno("could not write config file %s", config_filename);
error_errno(_("could not write config file %s"), config_filename);
ret = CONFIG_NO_WRITE;
goto out_free;
}
@@ -2992,7 +2992,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
memset(&store, 0, sizeof(store));

if (new_name && !section_name_is_ok(new_name)) {
ret = error("invalid section name: %s", new_name);
ret = error(_("invalid section name: %s"), new_name);
goto out_no_rollback;
}

@@ -3001,7 +3001,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename

out_fd = hold_lock_file_for_update(&lock, config_filename, 0);
if (out_fd < 0) {
ret = error("could not lock config file %s", config_filename);
ret = error(_("could not lock config file %s"), config_filename);
goto out;
}

@@ -3019,7 +3019,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
}

if (chmod(get_lock_file_path(&lock), st.st_mode & 07777) < 0) {
ret = error_errno("chmod on %s failed",
ret = error_errno(_("chmod on %s failed"),
get_lock_file_path(&lock));
goto out;
}
@@ -3116,7 +3116,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename
config_file = NULL;
commit_and_out:
if (commit_lock_file(&lock) < 0)
ret = error_errno("could not write config file %s",
ret = error_errno(_("could not write config file %s"),
config_filename);
out:
if (config_file)
@@ -3159,7 +3159,7 @@ int git_config_copy_section(const char *old_name, const char *new_name)
#undef config_error_nonbool
int config_error_nonbool(const char *var)
{
return error("missing value for '%s'", var);
return error(_("missing value for '%s'"), var);
}

int parse_config_key(const char *var,

+ 40
- 37
connect.c View File

@@ -58,7 +58,7 @@ static NORETURN void die_initial_contact(int unexpected)
* response does not necessarily mean an ACL problem, though.
*/
if (unexpected)
die(_("The remote end hung up upon initial contact"));
die(_("the remote end hung up upon initial contact"));
else
die(_("Could not read from remote repository.\n\n"
"Please make sure you have the correct access rights\n"
@@ -78,7 +78,7 @@ int server_supports_v2(const char *c, int die_on_error)
}

if (die_on_error)
die("server doesn't support '%s'", c);
die(_("server doesn't support '%s'"), c);

return 0;
}
@@ -100,7 +100,7 @@ int server_supports_feature(const char *c, const char *feature,
}

if (die_on_error)
die("server doesn't support feature '%s'", feature);
die(_("server doesn't support feature '%s'"), feature);

return 0;
}
@@ -111,7 +111,7 @@ static void process_capabilities_v2(struct packet_reader *reader)
argv_array_push(&server_capabilities_v2, reader->line);

if (reader->status != PACKET_READ_FLUSH)
die("expected flush after capabilities");
die(_("expected flush after capabilities"));
}

enum protocol_version discover_version(struct packet_reader *reader)
@@ -230,7 +230,7 @@ static int process_dummy_ref(const char *line)
static void check_no_capabilities(const char *line, int len)
{
if (strlen(line) != len)
warning("Ignoring capabilities after first line '%s'",
warning(_("ignoring capabilities after first line '%s'"),
line + strlen(line));
}

@@ -249,7 +249,7 @@ static int process_ref(const char *line, int len, struct ref ***list,
if (extra_have && !strcmp(name, ".have")) {
oid_array_append(extra_have, &old_oid);
} else if (!strcmp(name, "capabilities^{}")) {
die("protocol error: unexpected capabilities^{}");
die(_("protocol error: unexpected capabilities^{}"));
} else if (check_ref(name, flags)) {
struct ref *ref = alloc_ref(name);
oidcpy(&ref->old_oid, &old_oid);
@@ -270,9 +270,9 @@ static int process_shallow(const char *line, int len,
return 0;

if (get_oid_hex(arg, &old_oid))
die("protocol error: expected shallow sha-1, got '%s'", arg);
die(_("protocol error: expected shallow sha-1, got '%s'"), arg);
if (!shallow_points)
die("repository on the other end cannot be shallow");
die(_("repository on the other end cannot be shallow"));
oid_array_append(shallow_points, &old_oid);
check_no_capabilities(line, len);
return 1;
@@ -307,13 +307,13 @@ struct ref **get_remote_heads(struct packet_reader *reader,
case PACKET_READ_NORMAL:
len = reader->pktlen;
if (len > 4 && skip_prefix(reader->line, "ERR ", &arg))
die("remote error: %s", arg);
die(_("remote error: %s"), arg);
break;
case PACKET_READ_FLUSH:
state = EXPECTING_DONE;
break;
case PACKET_READ_DELIM:
die("invalid packet");
die(_("invalid packet"));
}

switch (state) {
@@ -333,7 +333,7 @@ struct ref **get_remote_heads(struct packet_reader *reader,
case EXPECTING_SHALLOW:
if (process_shallow(reader->line, len, shallow_points))
break;
die("protocol error: unexpected '%s'", reader->line);
die(_("protocol error: unexpected '%s'"), reader->line);
case EXPECTING_DONE:
break;
}
@@ -441,11 +441,11 @@ struct ref **get_remote_refs(int fd_out, struct packet_reader *reader,
/* Process response from server */
while (packet_reader_read(reader) == PACKET_READ_NORMAL) {
if (!process_ref_v2(reader->line, &list))
die("invalid ls-refs response: %s", reader->line);
die(_("invalid ls-refs response: %s"), reader->line);
}

if (reader->status != PACKET_READ_FLUSH)
die("expected flush after ref listing");
die(_("expected flush after ref listing"));

return list;
}
@@ -544,7 +544,7 @@ static enum protocol get_protocol(const char *name)
return PROTO_SSH;
if (!strcmp(name, "file"))
return PROTO_FILE;
die("I don't handle protocol '%s'", name);
die(_("protocol '%s' is not supported"), name);
}

static char *host_end(char **hoststart, int removebrackets)
@@ -595,8 +595,7 @@ static void enable_keepalive(int sockfd)
int ka = 1;

if (setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, &ka, sizeof(ka)) < 0)
fprintf(stderr, "unable to set SO_KEEPALIVE on socket: %s\n",
strerror(errno));
error_errno(_("unable to set SO_KEEPALIVE on socket"));
}

#ifndef NO_IPV6
@@ -636,14 +635,15 @@ static int git_tcp_connect_sock(char *host, int flags)
hints.ai_protocol = IPPROTO_TCP;

if (flags & CONNECT_VERBOSE)
fprintf(stderr, "Looking up %s ... ", host);
fprintf(stderr, _("Looking up %s ... "), host);

gai = getaddrinfo(host, port, &hints, &ai);
if (gai)
die("Unable to look up %s (port %s) (%s)", host, port, gai_strerror(gai));
die(_("unable to look up %s (port %s) (%s)"), host, port, gai_strerror(gai));

if (flags & CONNECT_VERBOSE)
fprintf(stderr, "done.\nConnecting to %s (port %s) ... ", host, port);
/* TRANSLATORS: this is the end of "Looking up %s ... " */
fprintf(stderr, _("done.\nConnecting to %s (port %s) ... "), host, port);

for (ai0 = ai; ai; ai = ai->ai_next, cnt++) {
sockfd = socket(ai->ai_family,
@@ -665,12 +665,13 @@ static int git_tcp_connect_sock(char *host, int flags)
freeaddrinfo(ai0);

if (sockfd < 0)
die("unable to connect to %s:\n%s", host, error_message.buf);
die(_("unable to connect to %s:\n%s"), host, error_message.buf);

enable_keepalive(sockfd);

if (flags & CONNECT_VERBOSE)
fprintf(stderr, "done.\n");
/* TRANSLATORS: this is the end of "Connecting to %s (port %s) ... " */
fprintf_ln(stderr, _("done."));

strbuf_release(&error_message);

@@ -697,22 +698,23 @@ static int git_tcp_connect_sock(char *host, int flags)
get_host_and_port(&host, &port);

if (flags & CONNECT_VERBOSE)
fprintf(stderr, "Looking up %s ... ", host);
fprintf(stderr, _("Looking up %s ... "), host);

he = gethostbyname(host);
if (!he)
die("Unable to look up %s (%s)", host, hstrerror(h_errno));
die(_("unable to look up %s (%s)"), host, hstrerror(h_errno));
nport = strtoul(port, &ep, 10);
if ( ep == port || *ep ) {
/* Not numeric */
struct servent *se = getservbyname(port,"tcp");
if ( !se )
die("Unknown port %s", port);
die(_("unknown port %s"), port);
nport = se->s_port;
}

if (flags & CONNECT_VERBOSE)
fprintf(stderr, "done.\nConnecting to %s (port %s) ... ", host, port);
/* TRANSLATORS: this is the end of "Looking up %s ... " */
fprintf(stderr, _("done.\nConnecting to %s (port %s) ... "), host, port);

for (cnt = 0, ap = he->h_addr_list; *ap; ap++, cnt++) {
memset(&sa, 0, sizeof sa);
@@ -740,12 +742,13 @@ static int git_tcp_connect_sock(char *host, int flags)
}

if (sockfd < 0)
die("unable to connect to %s:\n%s", host, error_message.buf);
die(_("unable to connect to %s:\n%s"), host, error_message.buf);

enable_keepalive(sockfd);

if (flags & CONNECT_VERBOSE)
fprintf(stderr, "done.\n");
/* TRANSLATORS: this is the end of "Connecting to %s (port %s) ... " */
fprintf_ln(stderr, _("done."));

return sockfd;
}
@@ -842,9 +845,9 @@ static struct child_process *git_proxy_connect(int fd[2], char *host)
get_host_and_port(&host, &port);

if (looks_like_command_line_option(host))
die("strange hostname '%s' blocked", host);
die(_("strange hostname '%s' blocked"), host);
if (looks_like_command_line_option(port))
die("strange port '%s' blocked", port);
die(_("strange port '%s' blocked"), port);

proxy = xmalloc(sizeof(*proxy));
child_process_init(proxy);
@@ -854,7 +857,7 @@ static struct child_process *git_proxy_connect(int fd[2], char *host)
proxy->in = -1;
proxy->out = -1;
if (start_command(proxy))
die("cannot start proxy %s", git_proxy_command);
die(_("cannot start proxy %s"), git_proxy_command);
fd[0] = proxy->out; /* read from proxy stdout */
fd[1] = proxy->in; /* write to proxy stdin */
return proxy;
@@ -921,7 +924,7 @@ static enum protocol parse_connect_url(const char *url_orig, char **ret_host,
path = strchr(end, separator);

if (!path || !*path)
die("No path specified. See 'man git-pull' for valid url syntax");
die(_("no path specified; see 'git help pull' for valid url syntax"));

/*
* null-terminate hostname and point path to ~ for URL's like this:
@@ -1116,7 +1119,7 @@ static void push_ssh_options(struct argv_array *args, struct argv_array *env,
case VARIANT_AUTO:
BUG("VARIANT_AUTO passed to push_ssh_options");
case VARIANT_SIMPLE:
die("ssh variant 'simple' does not support -4");
die(_("ssh variant 'simple' does not support -4"));
case VARIANT_SSH:
case VARIANT_PLINK:
case VARIANT_PUTTY:
@@ -1128,7 +1131,7 @@ static void push_ssh_options(struct argv_array *args, struct argv_array *env,
case VARIANT_AUTO:
BUG("VARIANT_AUTO passed to push_ssh_options");
case VARIANT_SIMPLE:
die("ssh variant 'simple' does not support -6");
die(_("ssh variant 'simple' does not support -6"));
case VARIANT_SSH:
case VARIANT_PLINK:
case VARIANT_PUTTY:
@@ -1145,7 +1148,7 @@ static void push_ssh_options(struct argv_array *args, struct argv_array *env,
case VARIANT_AUTO:
BUG("VARIANT_AUTO passed to push_ssh_options");
case VARIANT_SIMPLE:
die("ssh variant 'simple' does not support setting port");
die(_("ssh variant 'simple' does not support setting port"));
case VARIANT_SSH:
argv_array_push(args, "-p");
break;
@@ -1168,7 +1171,7 @@ static void fill_ssh_args(struct child_process *conn, const char *ssh_host,
enum ssh_variant variant;

if (looks_like_command_line_option(ssh_host))
die("strange hostname '%s' blocked", ssh_host);
die(_("strange hostname '%s' blocked"), ssh_host);

ssh = get_ssh_command();
if (ssh) {
@@ -1256,7 +1259,7 @@ struct child_process *git_connect(int fd[2], const char *url,
child_process_init(conn);

if (looks_like_command_line_option(path))
die("strange pathname '%s' blocked", path);
die(_("strange pathname '%s' blocked"), path);

strbuf_addstr(&cmd, prog);
strbuf_addch(&cmd, ' ');
@@ -1301,7 +1304,7 @@ struct child_process *git_connect(int fd[2], const char *url,
argv_array_push(&conn->args, cmd.buf);

if (start_command(conn))
die("unable to fork");
die(_("unable to fork"));

fd[0] = conn->out; /* read from child's stdout */
fd[1] = conn->in; /* write to child's stdin */

+ 22
- 20
convert.c View File

@@ -191,7 +191,7 @@ static enum eol output_eol(enum crlf_action crlf_action)
/* fall through */
return text_eol_is_crlf() ? EOL_CRLF : EOL_LF;
}
warning("Illegal crlf_action %d\n", (int)crlf_action);
warning(_("illegal crlf_action %d"), (int)crlf_action);
return core_eol;
}

@@ -204,11 +204,11 @@ static void check_global_conv_flags_eol(const char *path, enum crlf_action crlf_
* CRLFs would not be restored by checkout
*/
if (conv_flags & CONV_EOL_RNDTRP_DIE)
die(_("CRLF would be replaced by LF in %s."), path);
die(_("CRLF would be replaced by LF in %s"), path);
else if (conv_flags & CONV_EOL_RNDTRP_WARN)
warning(_("CRLF will be replaced by LF in %s.\n"
"The file will have its original line"
" endings in your working directory."), path);
" endings in your working directory"), path);
} else if (old_stats->lonelf && !new_stats->lonelf ) {
/*
* CRLFs would be added by checkout
@@ -218,7 +218,7 @@ static void check_global_conv_flags_eol(const char *path, enum crlf_action crlf_
else if (conv_flags & CONV_EOL_RNDTRP_WARN)
warning(_("LF will be replaced by CRLF in %s.\n"
"The file will have its original line"
" endings in your working directory."), path);
" endings in your working directory"), path);
}
}

@@ -493,8 +493,8 @@ static int encode_to_worktree(const char *path, const char *src, size_t src_len,
dst = reencode_string_len(src, src_len, enc, default_encoding,
&dst_len);
if (!dst) {
error("failed to encode '%s' from %s to %s",
path, default_encoding, enc);
error(_("failed to encode '%s' from %s to %s"),
path, default_encoding, enc);
return 0;
}

@@ -671,7 +671,8 @@ static int filter_buffer_or_fd(int in, int out, void *data)

if (start_command(&child_process)) {
strbuf_release(&cmd);
return error("cannot fork to run external filter '%s'", params->cmd);
return error(_("cannot fork to run external filter '%s'"),
params->cmd);
}

sigchain_push(SIGPIPE, SIG_IGN);
@@ -690,13 +691,14 @@ static int filter_buffer_or_fd(int in, int out, void *data)
if (close(child_process.in))
write_err = 1;
if (write_err)
error("cannot feed the input to external filter '%s'", params->cmd);
error(_("cannot feed the input to external filter '%s'"),
params->cmd);

sigchain_pop(SIGPIPE);

status = finish_command(&child_process);
if (status)
error("external filter '%s' failed %d", params->cmd, status);
error(_("external filter '%s' failed %d"), params->cmd, status);

strbuf_release(&cmd);
return (write_err || status);
@@ -731,13 +733,13 @@ static int apply_single_file_filter(const char *path, const char *src, size_t le
return 0; /* error was already reported */

if (strbuf_read(&nbuf, async.out, len) < 0) {
err = error("read from external filter '%s' failed", cmd);