Subject: Re: [PATCH] log which temporary file could not be created

From: Jonathan Nieder <[email-masked]>
Date: Sat, 9 Oct 2010 21:41:24 -0500

Hi,

Arnout Engelen wrote:

> When creating a temporary file, log the template.

Since mkstemp modifies its template, these hopefully would print the
actual filename on errors.  Examples:

	fatal: Unable to create temporary file '.merge_file_Sc7R5c': File exists
	fatal: Unable to create temporary file 'newrepo/.git/tOWHcxk': No space left on device

Unfortunately some mkstemp()s (such as that used to implement
git_mkstemp_mode()) clear the template on error, which would result in

	fatal: Unable to create temporary file '': Permission denied

What should git do in this situation?

> Useful for making debugging 
> problems like file permission mistakes easier.

Agreed.  Thanks.