Re: [PATCH] Make git status print a helpful death message if the disk is full
- From
Thomas Rast <trast@student.ethz.ch>
- Date
- Sep 1, 2009, 20:35 UTC
- Message-ID
- <200909012235.10091.trast@student.ethz.ch>
- In-Reply-To
- <4A9D7B54.5020902@facebook.com>
David Reiss wrote:
Show 5 quoted lines
> 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.
[...]
> 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));Junio C Hamano wrote:
> Don't we have die_errno() or something since at least 1.6.4?
Yes. And during the conversion, I ignored call sites like this one precisely because I did not (and still do not) have enough knowledge of the index and lock file machinery to decide at what stage I need to read errno to get the *real* error message. You're of course welcome to dig into the code to verify that the above is correct, but I am against blindly hoping that it gives the right error.
--
Thomas Rast
trast@{inf,student}.ethz.ch