git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: git@vger.kernel.org
Subject: [PATCH 1/2] show-index: uniform error messages for index read
Date: Mon,  1 Jun 2015 15:50:04 +0200	[thread overview]
Message-ID: <b87777a4de06a56472f2d23ab8bbce9a332bb2d7.1433166363.git.git@drmicha.warpmail.net> (raw)
In-Reply-To: <cover.1433166363.git.git@drmicha.warpmail.net>

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@drmicha.warpmail.net>
---
 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

  reply	other threads:[~2015-06-01 13:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-01 13:50 [PATCH 0/2] uniform error messages for index read and write Michael J Gruber
2015-06-01 13:50 ` Michael J Gruber [this message]
2015-06-01 13:50 ` [RFC/PATCH 2/2] messages: uniform error messages for index write Michael J Gruber
2015-06-01 23:01   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b87777a4de06a56472f2d23ab8bbce9a332bb2d7.1433166363.git.git@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).