diff options
author | Michael J Gruber <git@drmicha.warpmail.net> | 2015-06-01 15:50:05 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-06-01 16:01:21 -0700 |
commit | c1312cd3af14f6fd63d6ea152a8f2f63b7181838 (patch) | |
tree | 019d127b3568f07d4ebde3634ea54719c4306fc3 /builtin/commit.c | |
parent | 75f39dec396031ece8f36c8984bb3f46532f3b34 (diff) | |
download | git-mg/index-read-error-messages.tar.gz |
messages: uniform error messages for index writemg/index-read-error-messages
Currently, we have different wordings for the same index write error
message, which may be confusing to users and increases the risk of
more severely different translated messages:
builtin/add.c: die(_("Unable to write new index file"));
builtin/apply.c: die(_("Unable to write new index file"));
builtin/checkout.c: die(_("unable to write new index file"));
builtin/checkout-index.c: die("Unable to write new index file");
builtin/clone.c: die(_("unable to write new index file"));
builtin/commit.c: die(_("unable to create temporary index"));
builtin/commit.c: die(_("unable to update temporary index file"));
builtin/commit.c: die(_("unable to write index file"));
builtin/commit.c: die(_("unable to write new_index file"));
builtin/commit.c: die(_("unable to write new_index file"));
builtin/commit.c: die(_("unable to write new_index file"));
builtin/commit.c: die(_("unable to write temporary index file"));
builtin/commit.c: "new_index file. Check that disk is not full and quota is\n"
builtin/merge.c: return error(_("Unable to write index."));
builtin/mv.c: die(_("Unable to write new index file"));
builtin/read-tree.c: die("unable to write new index file");
builtin/rm.c: die(_("Unable to write new index file"));
builtin/update-index.c: die("Unable to write new index file");
merge.c: die(_("unable to write new index file"));
merge-recursive.c: return error(_("Unable to write index."));
pack-write.c: die_errno("unable to create '%s'", index_name);
rerere.c: die("Unable to write new index file");
sequencer.c: die(_("%s: Unable to write new index file"), action_name(opts));
test-scrap-cache-tree.c: die("unable to write index file");
Except for "checkout", "new index" always refers to the new state of the
index file, which is extra confusing. "checkout" does not talk about
"new work tree" (but "work tree") either. Therefore, word all of these
as "unable to write index file" (by possibly omitting "new" or "new_",
adjusting capitalization and punctuation, turning "create" into
"write"), except for:
* Leave "temporary" in place and add TRANSLATORS note.
It may happen that the index file is writable but not the temporary
one.
* Leave pack-write.c alone.
It is low level without l10n.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
-rw-r--r-- | builtin/commit.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index 2bc5092a57..6e7c6fd1b8 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -341,7 +341,8 @@ static const char *prepare_index(int argc, const char **argv, const char *prefix refresh_cache_or_die(refresh_flags); if (write_locked_index(&the_index, &index_lock, CLOSE_LOCK)) - die(_("unable to create temporary index")); + /* TRANSLATORS: match with "unable to write index file" */ + die(_("unable to write temporary index file")); old_index_env = getenv(INDEX_ENVIRONMENT); setenv(INDEX_ENVIRONMENT, index_lock.filename.buf, 1); @@ -360,7 +361,7 @@ static const char *prepare_index(int argc, const char **argv, const char *prefix if (reopen_lock_file(&index_lock) < 0) die(_("unable to write index file")); if (write_locked_index(&the_index, &index_lock, CLOSE_LOCK)) - die(_("unable to update temporary index")); + die(_("unable to write temporary index file")); } else warning(_("Failed to update main cache tree")); @@ -386,7 +387,7 @@ static const char *prepare_index(int argc, const char **argv, const char *prefix refresh_cache_or_die(refresh_flags); update_main_cache_tree(WRITE_TREE_SILENT); if (write_locked_index(&the_index, &index_lock, CLOSE_LOCK)) - die(_("unable to write new_index file")); + die(_("unable to write index file")); commit_style = COMMIT_NORMAL; return index_lock.filename.buf; } @@ -411,7 +412,7 @@ static const char *prepare_index(int argc, const char **argv, const char *prefix if (active_cache_changed) { if (write_locked_index(&the_index, &index_lock, COMMIT_LOCK)) - die(_("unable to write new_index file")); + die(_("unable to write index file")); } else { rollback_lock_file(&index_lock); } @@ -460,7 +461,7 @@ static const char *prepare_index(int argc, const char **argv, const char *prefix refresh_cache(REFRESH_QUIET); update_main_cache_tree(WRITE_TREE_SILENT); if (write_locked_index(&the_index, &index_lock, CLOSE_LOCK)) - die(_("unable to write new_index file")); + die(_("unable to write index file")); hold_lock_file_for_update(&false_lock, git_path("next-index-%"PRIuMAX, @@ -472,6 +473,7 @@ static const char *prepare_index(int argc, const char **argv, const char *prefix refresh_cache(REFRESH_QUIET); if (write_locked_index(&the_index, &false_lock, CLOSE_LOCK)) + /* TRANSLATORS: match with "unable to write index file" */ die(_("unable to write temporary index file")); discard_cache(); @@ -1784,8 +1786,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix) unlink(git_path("SQUASH_MSG")); if (commit_index_files()) + /* TRANSLATORS: match with "unable to write index file" */ die (_("Repository has been updated, but unable to write\n" - "new_index file. Check that disk is not full and quota is\n" + "index file. Check that disk is not full and quota is\n" "not exceeded, and then \"git reset HEAD\" to recover.")); rerere(0); |