From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] sha1_file.c: rename move_temp_to_file() to finalize_temp_file()
Date: Mon, 10 Aug 2015 10:32:56 -0700 [thread overview]
Message-ID: <xmqqmvxzujzr.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20150808091222.GA24707@sigill.intra.peff.net> (Jeff King's message of "Sat, 8 Aug 2015 05:12:22 -0400")
Jeff King <peff@peff.net> writes:
> On Fri, Aug 07, 2015 at 05:24:29PM -0700, Junio C Hamano wrote:
>
>> 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.
prev parent reply other threads:[~2015-08-10 17:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-08 0:24 [PATCH] sha1_file.c: rename move_temp_to_file() to finalize_temp_file() Junio C Hamano
2015-08-08 9:12 ` Jeff King
2015-08-10 17:32 ` Junio C Hamano [this message]
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=xmqqmvxzujzr.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).