Git development
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: ghazel@gmail.com
Cc: git@vger.kernel.org
Subject: Re: git reset and ctime
Date: Fri, 3 Dec 2010 18:51:32 -0600	[thread overview]
Message-ID: <20101204005131.GB15906@burratino> (raw)
In-Reply-To: <AANLkTimyYTup+PqJFJ+2g-tVwWXA2bxTT3noonEuKBSu@mail.gmail.com>

Hi Greg,

ghazel@gmail.com wrote:

> I've encountered a strange issue where "git reset --hard" insists on
> "Checking out files ..." when all that is changed is the ctime

There is a performance trade-off.  Refreshing the index requires
reading+hashing the existing file if the stat information changed;
this could be faster or slower than blindly overwriting depending on
the situation.

That said, I have no strong objection to an implicit refresh in "git
reset" (performance-sensitive scripts should be using read-tree
directly anyway).  Have you tried making that change to
builtin/reset.c?  How does it perform in practice?

>              My deploy process (capistrano) maintains a cached copy of
> a git repo, which it fetches, resets, and then hardlinks files from
> when a deploy occurs ( https://github.com/37signals/fast_remote_cache
> ). The hardlinking step is meant to save the time of copying the file.
> but hardlinking changes the ctime of the source files.

Interesting.  Setting "[core] trustctime = false" in the repository
configuration could be a good solution (no performance downside I can
think of).

Hope that helps,
Jonathan

  reply	other threads:[~2010-12-04  0:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-03 21:36 git reset and ctime ghazel
2010-12-04  0:51 ` Jonathan Nieder [this message]
2010-12-04  1:39   ` ghazel
2010-12-04  1:47     ` Jonathan Nieder
2010-12-04  2:28   ` Junio C Hamano
2010-12-06 17:37   ` Drew Northup
2010-12-06 17:51     ` Jonathan Nieder
2010-12-07 15:14       ` Drew Northup

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=20101204005131.GB15906@burratino \
    --to=jrnieder@gmail.com \
    --cc=ghazel@gmail.com \
    --cc=git@vger.kernel.org \
    /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