[PATCH 1/2] show-index: uniform error messages for index read

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently, we have different wordings for the same index read error
message, which may be confusing to users and increase3s the risk of more
severely different translated messages:

builtin/apply.c:			die(_("unable to read index file"));
show-index.c:			die("unable to read index");
show-index.c:			die("unable to read index");
test-dump-cache-tree.c:		die("unable to read index file");
test-dump-untracked-cache.c:		die("unable to read index file");
test-scrap-cache-tree.c:		die("unable to read index file");
builtin/commit.c:			die(_("Cannot read index"));
rerere.c:		return error("Could not read index");
rerere.c:		return error("Could not read index");
rerere.c:		return error("Could not read index");

Turn all of them into "unable to read index file" except for the rerere
messages: They appear on a higher level (index file access + parsing)
and are worded similarly to other rerere messages.

Signed-off-by: Michael J Gruber <git@xxxxxxxxxxxxxxxxxxxx>
---
 builtin/commit.c | 2 +-
 show-index.c     | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index 254477f..04d49d5 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -878,7 +878,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 		const char *parent = "HEAD";
 
 		if (!active_nr && read_cache() < 0)
-			die(_("Cannot read index"));
+			die(_("unable to read index file"));
 
 		if (amend)
 			parent = "HEAD^1";
diff --git a/show-index.c b/show-index.c
index 5a9eed7..e7797d0 100644
--- a/show-index.c
+++ b/show-index.c
@@ -22,11 +22,11 @@ int main(int argc, char **argv)
 		if (version < 2 || version > 2)
 			die("unknown index version");
 		if (fread(top_index, 256 * 4, 1, stdin) != 1)
-			die("unable to read index");
+			die("unable to read index file");
 	} else {
 		version = 1;
 		if (fread(&top_index[2], 254 * 4, 1, stdin) != 1)
-			die("unable to read index");
+			die("unable to read index file");
 	}
 	nr = 0;
 	for (i = 0; i < 256; i++) {
-- 
2.4.2.548.g1e81565

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]