From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: luciano.rocha@booking.com, git@vger.kernel.org
Subject: Re: [External] Re: [PATCH 1/1] freshen_file(): use NULL `times' for implicit current-time
Date: Wed, 15 Apr 2020 10:30:14 -0700 [thread overview]
Message-ID: <xmqq7dyg7j2x.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <20200415160535.GF2464307@coredump.intra.peff.net> (Jeff King's message of "Wed, 15 Apr 2020 12:05:35 -0400")
Jeff King <peff@peff.net> writes:
> On Wed, Apr 15, 2020 at 11:09:06AM +0200, luciano.rocha@booking.com wrote:
>
>> > The old code was setting the time based on the system time from time().
>> > We've occasionally hit cases where the filesystem time and the system
>> > time do not match exactly (this might be true on an NFS mount, for
>> > example).
>> >
>> > It's not clear to me whether utime(NULL) would be using the system or
>> > filesystem time in such a case. If the former, then there's no change in
>> > behavior. If the latter, I'd argue that it's probably an _improvement_,
>> > since we're simulating the case that we wrote a new file with a new
>> > mtime.
>>
>> I'm not that familiar with kernel code, so can't say for sure. From a
>> cursory look, it doesn't seem like it uses the remote server's time.
>>
>> But it does seem to have a higher precision, for filesystems that
>> support it.
>
> Yeah, that's another point in its favor.
>
> It seems pretty clear to me that utime(NULL) should give either the same
> or better behavior in all cases.
Yup, thanks Luciano for the patch and Peff for a (n always) good
review.
next prev parent reply other threads:[~2020-04-15 17:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-14 14:27 [PATCH 1/1] freshen_file(): use NULL `times' for implicit current-time luciano.rocha
2020-04-14 19:55 ` Jeff King
2020-04-15 9:09 ` [External] " luciano.rocha
2020-04-15 16:05 ` Jeff King
2020-04-15 17:30 ` Junio C Hamano [this message]
2020-04-15 21:36 ` Junio C Hamano
2020-04-15 23:48 ` brian m. carlson
2020-04-16 1:02 ` Junio C Hamano
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=xmqq7dyg7j2x.fsf@gitster.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=luciano.rocha@booking.com \
--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).