commit: do not use cryptic "new_index" in end-user facing messages

These error messages say "new_index" as if that spelling has some significance to the end users (e.g. the file "$GIT_DIR/new_index" has some issues), but that is not the case at all. The i18n folks were made to include the word literally in the translated messages, which was not a good idea at all. Spell it "new index", as we are just telling the users that we failed to create a new index file. The term is expected to be translated to the end-users' languages, not left as if it were a literal file name. This dates all the way back to the first re-implemenation of "git commit" command in C (the scripted version did not have such wording in its error messages), in f5bbc322 (Port git commit to C., 2007-11-08). Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Oct 17, 2023 at 20:08 UTC a060705d94461fdaa9512217d584bcb7fe3a109a
1 file changed +4 -4
builtin/commit.c
+4 -4
@@ -446,7 +446,7 @@ static const char *prepare_index(const char **argv, const char *prefix,
446 refresh_cache_or_die(refresh_flags);
447 cache_tree_update(&the_index, WRITE_TREE_SILENT);
448 if (write_locked_index(&the_index, &index_lock, 0))
449 - die(_("unable to write new_index file"));
449 + die(_("unable to write new index file"));
450 commit_style = COMMIT_NORMAL;
451 ret = get_lock_file_path(&index_lock);
452 goto out;
@@ -470,7 +470,7 @@ static const char *prepare_index(const char **argv, const char *prefix,
470 cache_tree_update(&the_index, WRITE_TREE_SILENT);
471 if (write_locked_index(&the_index, &index_lock,
472 COMMIT_LOCK | SKIP_IF_UNCHANGED))
473 - die(_("unable to write new_index file"));
473 + die(_("unable to write new index file"));
474 commit_style = COMMIT_AS_IS;
475 ret = get_index_file();
476 goto out;
@@ -518,7 +518,7 @@ static const char *prepare_index(const char **argv, const char *prefix,
518 refresh_index(&the_index, REFRESH_QUIET, NULL, NULL, NULL);
519 cache_tree_update(&the_index, WRITE_TREE_SILENT);
520 if (write_locked_index(&the_index, &index_lock, 0))
521 - die(_("unable to write new_index file"));
521 + die(_("unable to write new index file"));
522
523 hold_lock_file_for_update(&false_lock,
524 git_path("next-index-%"PRIuMAX,
@@ -1852,7 +1852,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
1852
1853 if (commit_index_files())
1854 die(_("repository has been updated, but unable to write\n"
1855 - "new_index file. Check that disk is not full and quota is\n"
1855 + "new index file. Check that disk is not full and quota is\n"
1856 "not exceeded, and then \"git restore --staged :/\" to recover."));
1857
1858 git_test_write_commit_graph_or_die();