From: Junio C Hamano Date: Wed, 02 Dec 2015 02:19:29 GMT Subject: Re: [PATCH] Make error message after failing commit_lock_file() less confusing Message-ID: In-Reply-To: <20151201231701.GB13245@sigill.intra.peff.net> Jeff King writes: > On Mon, Nov 30, 2015 at 12:40:53PM +0100, SZEDER Gábor wrote: > >> The error message after a failing commit_lock_file() call sometimes >> looks like this, causing confusion: >> >> $ git remote add remote git@server.com/repo.git >> error: could not commit config file .git/config >> # Huh?! >> # I didn't want to commit anything, especially not my config file! > > I like the intent of this patch; I've had the same "huh" moment myself. > >> The error message is of course bikeshedable. > > You chose "write", which I think is OK. It's really a "rename", and > maybe that matters for some values of errno. I'd guess in practice > probably not (the likely reason is going to be something like EPERM). > And I can't think of a concise way to express rename (just saying > "rename" is confusing, too, without indicating that it's from the > tempfile to the final resting place). > > So perhaps "write" is the best we can do. Yeah, "finalize" came to me but "write" is far easier to understand by laypeople.