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

Re: [PATCH] Perform minimal stat comparison when some stat fields are not set

From
Robin Rosenberg <robin.rosenberg@dewire.com>
Date
Dec 6, 2012, 11:16 UTC
Message-ID
<578723621.19434897.1354792587152.JavaMail.root@dewire.com>
In-Reply-To
<50C0475F.1030206@viscovery.net>
----- Ursprungligt meddelande -----
Show 19 quoted lines
> Am 12/6/2012 2:09, schrieb Robin Rosenberg:
> >> Robin Rosenberg <robin.rosenberg@dewire.com> writes:
> >>> At least JGit does sets uid, gid, ctime, ino and dev fields to
> >>> zero
> >>> on update. To Git this looks like the stat data does not match
> >>> and
> >>> a full file compare will be forced even it size and mtime match.
> >>> This
> >>> is in practice unnecessary. Sense JGit's presence by checking if
> >>> ino
> >>> and dev is zero.
> 
> Is this meant to better support C git and JGit working on the same
> repository?
> 
> MinGW git sets these two stat fields to zero as well. But we have
> less of
> an interoparability problem between different git implementations in
> practice on Windows, I think.
It is purely for performance in some situations.
Show 15 quoted lines
> >> Besides, is it sane to do this unconditionally to affect people
> >> who
> >> do not use JGit?
> > 
> > Would a config option like core.minstat be better? The name would
> > imply no dynamic detection.
> 
> A configuration option is the way to go. We already have
> core.trustctime,
> core.symlinks, core.filemode, core.ignoreCygwinFSTricks.
> 
> But your new mode is not "minimal". In some implementations or on
> some
> filesystems, even more bits of stat information could be meaningless
> (think of atime, rdev, nlink, uid, gid). Perhaps core.trustdevandino?

I already excluded uid and gid so the only thing left is mtime and size. I can't see any reason for anyone to look at atime (somebody read the file, so what?), ok for rdev and nlink, but we don not look at them my patch does not avoid looking at them.

> Or
> an enumeration core.ignoreCacheStat=ctime,dev,ino?
That would mean only one configuration option. Good.
-- robin
Previous: Johannes SixtNext: Robin Rosenberg
Message 5 of 29 in “Perform minimal stat comparison when some stat fields are not set”
  1. Perform minimal stat comparison when some stat fields are not setRobin Rosenberg, Dec 5, 2012
  2. Junio C HamanoDec 5, 2012
  3. Robin RosenbergDec 6, 2012
  4. Johannes SixtDec 6, 2012
  5. Robin RosenbergDec 6, 2012
  6. Make git selectively and conditionally ignore certain stat fieldsRobin Rosenberg, Jan 14, 2013
  7. Junio C HamanoJan 14, 2013
  8. Robin RosenbergJan 14, 2013
  9. Junio C HamanoJan 15, 2013
  10. Robin RosenbergJan 15, 2013
  11. Johannes SixtJan 15, 2013
  12. Robin RosenbergJan 15, 2013
  13. Junio C HamanoJan 15, 2013
  14. Ramsay JonesJan 16, 2013
  15. Robin RosenbergJan 20, 2013
  16. Junio C HamanoJan 20, 2013
  17. Enable minimal stat checkingRobin Rosenberg, Jan 22, 2013
  18. Johannes SixtJan 22, 2013
  19. Torsten BögershausenJan 22, 2013
  20. Junio C HamanoJan 22, 2013
  21. Robin RosenbergJan 22, 2013
  22. Jeff KingMay 6, 2013
  23. Junio C HamanoMay 7, 2013
  24. deprecate core.statinfo at Git 2.0 boundaryJunio C Hamano, May 7, 2013
  25. Junio C HamanoMay 7, 2013
  26. Jeff KingMay 7, 2013
  27. Robin RosenbergMay 7, 2013
  28. Make git selectively and conditionally ignore certain stat fieldsRobin Rosenberg, Jan 14, 2013
  29. Junio C HamanoJan 14, 2013

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.