All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Reiss <dreiss@facebook.com>
To: <git@vger.kernel.org>
Subject: [PATCH] Make git status print a helpful death message if the disk is full
Date: Tue, 1 Sep 2009 12:51:48 -0700	[thread overview]
Message-ID: <4A9D7B54.5020902@facebook.com> (raw)

The old behavior just said that it failed.  Now it includes the error
information, which makes it much easier to debug.

There is a risk that some failure paths could result in misleading error
messages that actually make debugging more difficult.

Signed-off-by: David Reiss <dreiss@facebook.com>
---
 builtin-commit.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/builtin-commit.c b/builtin-commit.c
index 4bcce06..3527c73 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -256,7 +256,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix)
 		refresh_cache(REFRESH_QUIET);
 		if (write_cache(fd, active_cache, active_nr) ||
 		    close_lock_file(&index_lock))
-			die("unable to write new_index file");
+			die("unable to write new_index file: %s", strerror(errno));
 		commit_style = COMMIT_NORMAL;
 		return index_lock.filename;
 	}
@@ -275,7 +275,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix)
 		refresh_cache(REFRESH_QUIET);
 		if (write_cache(fd, active_cache, active_nr) ||
 		    commit_locked_index(&index_lock))
-			die("unable to write new_index file");
+			die("unable to write new_index file: %s", strerror(errno));
 		commit_style = COMMIT_AS_IS;
 		return get_index_file();
 	}
@@ -318,7 +318,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix)
 	refresh_cache(REFRESH_QUIET);
 	if (write_cache(fd, active_cache, active_nr) ||
 	    close_lock_file(&index_lock))
-		die("unable to write new_index file");
+		die("unable to write new_index file: %s", strerror(errno));
 
 	fd = hold_lock_file_for_update(&false_lock,
 				       git_path("next-index-%"PRIuMAX,
-- 
1.6.0.4

             reply	other threads:[~2009-09-01 19:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-01 19:51 David Reiss [this message]
2009-09-01 20:19 ` [PATCH] Make git status print a helpful death message if the disk is full Junio C Hamano
2009-09-01 20:35 ` Thomas Rast

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=4A9D7B54.5020902@facebook.com \
    --to=dreiss@facebook.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.