git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Riesen <raa.lkml@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Johannes Sixt <j.sixt@viscovery.net>,
	git@vger.kernel.org
Subject: [PATCH] Do not use ctime if file mode is not used
Date: Thu, 24 Jul 2008 21:00:56 +0200	[thread overview]
Message-ID: <20080724190056.GA3677@blimp.local> (raw)
In-Reply-To: <7vr69lihkt.fsf@gitster.siamese.dyndns.org>

On some file systems, the only part of inode information we need
(executable) cannot be used, so ctime can be ignored as well. Change
time is updated when file attributes were changed (or it is written
to, but in this case, mtime is updated as well).

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---

Junio C Hamano, Wed, Jul 23, 2008 02:12:50 +0200:
> > I had that at first (NO_DEPENDABLE_CTIME, than IGNORE_CTIME), than
> > deemed it excessive.
> 
> Why is it excessive?  My initial reaction was "what does trustable
> filemode nor trust_executable_bit has anything to do with ctime".  Please
> explain.

You know, you have a good point... (and I'm sometimes really stupid)
Of course it depends on the underlying filesystem!

The updated patch is untested yet, but should be obviously correct.

BTW, any idea how to check if all callers of ce_match_stat_basic have
read the configuration? It is not that essential to have
trust_executable_bit set correctly, though. In worst case an index
entry will be marked not up-to-date.

 read-cache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/read-cache.c b/read-cache.c
index a50a851..f2fa0d9 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -181,7 +181,7 @@ static int ce_match_stat_basic(struct cache_entry *ce, struct stat *st)
 	}
 	if (ce->ce_mtime != (unsigned int) st->st_mtime)
 		changed |= MTIME_CHANGED;
-	if (ce->ce_ctime != (unsigned int) st->st_ctime)
+	if (trust_executable_bit && ce->ce_ctime != (unsigned int) st->st_ctime)
 		changed |= CTIME_CHANGED;
 
 	if (ce->ce_uid != (unsigned int) st->st_uid ||
-- 
1.6.0.rc0.70.g5aae9

  parent reply	other threads:[~2008-07-24 20:15 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-21 17:35 [PATCH] Fix update-index --refresh for submodules if stat(2) returns st_size 0 Alex Riesen
2008-07-21 18:20 ` Johannes Schindelin
2008-07-21 19:43   ` Alex Riesen
2008-07-21 23:26     ` Johannes Schindelin
2008-07-22  8:07     ` Junio C Hamano
2008-07-22 16:49       ` Alex Riesen
2008-07-22  7:17 ` Johannes Sixt
2008-07-22 16:46   ` Alex Riesen
2008-07-22 16:59     ` Johannes Sixt
2008-07-22 17:28   ` Junio C Hamano
2008-07-22 19:39     ` [PATCH] Build configuration to skip ctime for modification test Alex Riesen
2008-07-22 20:17       ` Johannes Schindelin
2008-07-22 20:31         ` Alex Riesen
2008-07-23  0:12           ` Junio C Hamano
2008-07-23 16:46             ` Alex Riesen
2008-07-23 16:59               ` Johannes Schindelin
2008-07-23 19:16                 ` Alex Riesen
2008-07-25  2:00                   ` Linus Torvalds
2008-07-25  5:55                     ` Alex Riesen
2008-07-26  0:57                       ` Johannes Schindelin
2008-07-26 15:38                         ` [PATCH] Make use of stat.ctime configurable Alex Riesen
2008-07-27 19:46                           ` Junio C Hamano
2008-07-27 19:46                           ` Junio C Hamano
2008-07-28  6:31                             ` Alex Riesen
2008-07-28 16:04                               ` David Brown
2008-07-28 16:09                                 ` Linus Torvalds
2008-07-28 21:49                                   ` Alex Riesen
2008-07-29  1:16                                   ` Junio C Hamano
2008-07-29  1:23                                     ` Linus Torvalds
2008-07-29  1:31                                       ` Junio C Hamano
2008-07-29  1:41                                         ` David Brown
2008-07-29  2:49                                           ` Junio C Hamano
2008-07-29 10:45                                           ` Johannes Schindelin
2008-07-29  1:55                                         ` Linus Torvalds
2008-07-29  2:01                                           ` Linus Torvalds
2008-07-29 10:49                                       ` Johannes Schindelin
2008-07-28 16:20                               ` Petr Baudis
2008-07-28 21:47                                 ` [PATCH] Improve the placement of core.trustctime in the documentation Alex Riesen
2008-07-29  6:23                                   ` Junio C Hamano
2008-07-24 19:00             ` Alex Riesen [this message]
2008-07-23 16:00           ` git svn throws locale related error when built from source Anton Mostovoy

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=20080724190056.GA3677@blimp.local \
    --to=raa.lkml@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j.sixt@viscovery.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).