Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] sha1_file.c: rename move_temp_to_file() to finalize_temp_file()

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:06:08

Jeff King [off-list ref] writes:
On Fri, Aug 07, 2015 at 05:24:29PM -0700, Junio C Hamano wrote:
quoted
Since 5a688fe4 ("core.sharedrepository = 0mode" should set, not
loosen, 2009-03-25), we kept reminding ourselves:

    NEEDSWORK: this should be renamed to finalize_temp_file() as
    "moving" is only a part of what it does, when no patch between
    master to pu changes the call sites of this function.

without doing anything about it.  Let's do so.

The purpose of this function was not to move but to finalize.  The
detail of the primarily implementation of finalizing was to link the
temporary file to its final name and then to unlink, which wasn't
even "moving".  The alternative implementation did "move" by calling
rename(2), which is a fun tangent.
This is definitely a better name. But while we are touching the area, my
other pet peeve about this function is that it is really specific to
moving _object_ temp files around. It started life as static-local to
sha1-file.c, so not mentioning objects is OK, but when it became a
global, it's a bit confusing.

Maybe finalize_object_file() would be a better name?

-Peff
OK, will fix.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help