From: Alex Riesen <raa.lkml@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Junio C Hamano <gitster@pobox.com>,
Johannes Sixt <j.sixt@viscovery.net>,
git@vger.kernel.org
Subject: [PATCH] Make use of stat.ctime configurable
Date: Sat, 26 Jul 2008 17:38:02 +0200 [thread overview]
Message-ID: <20080726153802.GA16868@blimp.local> (raw)
In-Reply-To: <alpine.DEB.1.00.0807260256030.11976@eeepc-johanness>
because there are situations where it produces too much false
positives. Like when file system crawlers keep changing it when
scanning and using the ctime for marking scanned files.
The default is to allow use of ctime.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
Johannes Schindelin, Sat, Jul 26, 2008 02:57:25 +0200:
> On Fri, 25 Jul 2008, Alex Riesen wrote:
> > But, given the fact, that somewhere sometimes its very-very annoying to
> > have even one (un)changed file, something must be done about it. Maybe
> > just direct
> >
> > [...]
> > trustctime = false
>
> ... which is all Junio and I were asking all along: a separate way to ask
> for ignoring ctime; not just DWIM it on top of the executable bit.
Oh...
cache.h | 1 +
config.c | 4 ++++
environment.c | 1 +
read-cache.c | 2 +-
4 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/cache.h b/cache.h
index 38985aa..00d02d3 100644
--- a/cache.h
+++ b/cache.h
@@ -421,6 +421,7 @@ extern int delete_ref(const char *, const unsigned char *sha1);
/* Environment bits from configuration mechanism */
extern int trust_executable_bit;
+extern int trust_file_ctime;
extern int quote_path_fully;
extern int has_symlinks;
extern int ignore_case;
diff --git a/config.c b/config.c
index 1e066c7..860e8ab 100644
--- a/config.c
+++ b/config.c
@@ -341,6 +341,10 @@ static int git_default_core_config(const char *var, const char *value)
trust_executable_bit = git_config_bool(var, value);
return 0;
}
+ if (!strcmp(var, "core.filectime")) {
+ trust_file_ctime = git_config_bool(var, value);
+ return 0;
+ }
if (!strcmp(var, "core.quotepath")) {
quote_path_fully = git_config_bool(var, value);
diff --git a/environment.c b/environment.c
index 4a88a17..4982771 100644
--- a/environment.c
+++ b/environment.c
@@ -13,6 +13,7 @@ char git_default_email[MAX_GITNAME];
char git_default_name[MAX_GITNAME];
int user_ident_explicitly_given;
int trust_executable_bit = 1;
+int trust_file_ctime = 1;
int has_symlinks = 1;
int ignore_case;
int assume_unchanged;
diff --git a/read-cache.c b/read-cache.c
index a50a851..00d39dc 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_file_ctime && ce->ce_ctime != (unsigned int) st->st_ctime)
changed |= CTIME_CHANGED;
if (ce->ce_uid != (unsigned int) st->st_uid ||
--
1.6.0.rc0.76.g581e
next prev parent reply other threads:[~2008-07-27 10:09 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 ` Alex Riesen [this message]
2008-07-27 19:46 ` [PATCH] Make use of stat.ctime configurable 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 ` [PATCH] Do not use ctime if file mode is not used Alex Riesen
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=20080726153802.GA16868@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 \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).