git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[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
Previous: Junio C HamanoNext: Johannes Schindelin
Message 11 of 41 in “Fix update-index --refresh for submodules if stat(2) returns st_size 0”
  1. Fix update-index --refresh for submodules if stat(2) returns st_size 0Alex Riesen, Jul 21, 2008
  2. Johannes SchindelinJul 21, 2008
  3. Alex RiesenJul 21, 2008
  4. Johannes SchindelinJul 21, 2008
  5. Junio C HamanoJul 22, 2008
  6. Alex RiesenJul 22, 2008
  7. Johannes SixtJul 22, 2008
  8. Alex RiesenJul 22, 2008
  9. Johannes SixtJul 22, 2008
  10. Junio C HamanoJul 22, 2008
  11. Build configuration to skip ctime for modification testAlex Riesen, Jul 22, 2008
  12. Johannes SchindelinJul 22, 2008
  13. Alex RiesenJul 22, 2008
  14. Junio C HamanoJul 23, 2008
  15. Alex RiesenJul 23, 2008
  16. Johannes SchindelinJul 23, 2008
  17. Alex RiesenJul 23, 2008
  18. Linus TorvaldsJul 25, 2008
  19. Alex RiesenJul 25, 2008
  20. Johannes SchindelinJul 26, 2008
  21. Make use of stat.ctime configurableAlex Riesen, Jul 26, 2008
  22. Junio C HamanoJul 27, 2008
  23. Junio C HamanoJul 27, 2008
  24. Make use of stat.ctime configurableAlex Riesen, Jul 28, 2008
  25. David BrownJul 28, 2008
  26. Linus TorvaldsJul 28, 2008
  27. Alex RiesenJul 28, 2008
  28. Junio C HamanoJul 29, 2008
  29. Linus TorvaldsJul 29, 2008
  30. Junio C HamanoJul 29, 2008
  31. David BrownJul 29, 2008
  32. Junio C HamanoJul 29, 2008
  33. Johannes SchindelinJul 29, 2008
  34. Linus TorvaldsJul 29, 2008
  35. Linus TorvaldsJul 29, 2008
  36. Johannes SchindelinJul 29, 2008
  37. Petr BaudisJul 28, 2008
  38. Improve the placement of core.trustctime in the documentationAlex Riesen, Jul 28, 2008
  39. Junio C HamanoJul 29, 2008
  40. Do not use ctime if file mode is not usedAlex Riesen, Jul 24, 2008
  41. git svn throws locale related error when built from sourceAnton Mostovoy, Jul 23, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.