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

Re: [PATCH v2] Make git selectively and conditionally ignore certain stat fields

From
Robin Rosenberg <robin.rosenberg@dewire.com>
Date
Jan 14, 2013, 23:43 UTC
Message-ID
<1815551092.2039693.1358207014937.JavaMail.root@dewire.com>
In-Reply-To
<7vmwwb8m25.fsf@alter.siamese.dyndns.org>
----- Ursprungligt meddelande -----
Show 24 quoted lines
> Robin Rosenberg <robin.rosenberg@dewire.com> writes:
> 
> > diff --git a/read-cache.c b/read-cache.c
> > index fda78bc..f7fe15d 100644
> > --- a/read-cache.c
> > +++ b/read-cache.c
> > @@ -197,8 +197,9 @@ static int ce_match_stat_basic(struct
> > cache_entry *ce, struct stat *st)
> >  	}
> >  	if (ce->ce_mtime.sec != (unsigned int)st->st_mtime)
> >  		changed |= MTIME_CHANGED;
> > -	if (trust_ctime && ce->ce_ctime.sec != (unsigned
> > int)st->st_ctime)
> > -		changed |= CTIME_CHANGED;
> > +	if ((trust_ctime ||
> > ((check_nonzero_stat&CHECK_NONZERO_STAT_CTIME) &&
> > ce->ce_ctime.sec)))
> 
> One SP is required on each side of a binary operator; please have
> one after check_nonzero_stat and after the & after it.
> 
> I wonder if we should lose the trust_ctime variable and use this
> check_nonzero_stat bitset exclusively, provided that this were a
> good direction to go?

Semantically they're somewhat different. My flags are for ignoring a value when it's not used as indicated by the value zero, while trustctime is for ignoring untrustworthy, non-zero, values.

>From 1ce4790bf5e:
    A new configuration variable 'core.trustctime' is introduced to
    allow ignoring st_ctime information when checking if paths
    in the working tree has changed, 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.
(your second mail)
Show 6 quoted lines
>Also I am getting these:
>
>config.c: In function 'git_default_core_config':
>config.c:571: error: passing argument 1 of 'git_config_string' from incompatible pointer type
>config.c:540: note: expected 'const char **' but argument is of type 'char **'
>config.c:573: error: passing argument 1 of 'strtok' discards qualifiers from pointer target type

Different compilers have different defaults. I'm on OS X (mountain lion), or am I missing something? I do get a warning. Am I allowed to modify the value, like strtok does? Seems I missed the opportunity to use the copy rather then the original value.

Another thing that I noticed, is that I probably wanto to be able to filter on the precision of timestamps. Again, this i JGit-related. Current JGit has milliseconds precision (max), whereas Git has down to nanosecond precision in timestamps. Newer JGits may get nanoseconds timestamps too, but on current Linux versions JGit gets only integral seconds regardless of file system.

Would the names, milli, micro, nano be good for ignoring the tail when zero, or n1..n9 (obviously n2 would be ok too). nN = ignore all but first N nsec digits if they are zero)?

-- robin
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 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.