[PATCH] Build configuration to skip ctime for modification test
- From
Alex Riesen <raa.lkml@gmail.com>
- Date
- Jul 22, 2008, 19:39 UTC
- Message-ID
- <20080722193901.GA5113@blimp.local>
- In-Reply-To
- <7vy73tltf5.fsf@gitster.siamese.dyndns.org>
On Windows, the only file attribute 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, Tue, Jul 22, 2008 19:28:46 +0200:
Show 14 quoted lines
> Johannes Sixt <j.sixt@viscovery.net> writes: > > >> + if ((changed & DATA_CHANGED) && (ce->ce_size != 0 || S_ISGITLINK(ce->ce_mode))) > > > > Does this mean that ce->ce_size is non-zero for gitlinks, at least on > > Unix? Is this value useful in anyway? I don't think so. Then it shouldn't > > be a random value that lstat() happens to return. > > These ce_xxx fields are the values we read from lstat(2) when the user > told us to stage that working tree entity, be it a regular file, a > symlink, or a directory that is a submodule. The only thing required for > them is that they are stable (i.e. if you haven't touched the working tree > entity, the value stays the same), and changes across modification. The > value itself does not have to "mean" anything.
This reminds me... We can't use the only file attribute we care about on Windows, so we can as well skip check for ctime. Besides, Google Desktop Search keeps changing ctime when crawling files (ok, GDS is a major usability nuance anyway, but the point is - we don't use the file attribute).
read-cache.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/read-cache.c b/read-cache.c index a50a851..c4f2718 100644 --- a/read-cache.c +++ b/read-cache.c @@ -181,8 +181,10 @@ 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; +#ifndef NO_TRUSTABLE_FILEMODE if (ce->ce_ctime != (unsigned int) st->st_ctime) changed |= CTIME_CHANGED; +#endif if (ce->ce_uid != (unsigned int) st->st_uid || ce->ce_gid != (unsigned int) st->st_gid)
-- 1.6.0.rc0.41.g70446