From: Torsten Bögershausen Date: Tue, 22 Jan 2013 17:19:16 GMT Subject: Re: [PATCH v3] Enable minimal stat checking Message-ID: <50FECA14.5030802@web.de> In-Reply-To: <1358840962-12316-1-git-send-email-robin.rosenberg@dewire.com> +core.checkstat:: + Determines which stat fields to match between the index + and work tree. The user can set this to 'default' or + 'minimal'. Default (or explicitly 'default'), is to check + all fields, including the sub-second part of mtime and ctime. + Setting 'minimal' implies core.trustctime = false [snip] > - if (trust_ctime && ce->ce_ctime.sec != (unsigned int)st->st_ctime) > - changed |= CTIME_CHANGED; > + if (trust_ctime ? check_stat : trust_ctime/*false*/) > + if (ce->ce_ctime.sec != (unsigned int)st->st_ctime) > + changed |= CTIME_CHANGED; Could that be written as: + if (trust_ctime && check_stat && (ce->ce_ctime.sec != (unsigned int)st->st_ctime)) + changed |= CTIME_CHANGED; > > #ifdef USE_NSEC > - if (ce->ce_mtime.nsec != ST_MTIME_NSEC(*st)) > + if (check_stat && ce->ce_mtime.nsec != ST_MTIME_NSEC(*st)) > changed |= MTIME_CHANGED; > - if (trust_ctime && ce->ce_ctime.nsec != ST_CTIME_NSEC(*st)) > - changed |= CTIME_CHANGED; > + if (trust_ctime ? check_stat : trust_ctime/*false*/) > + if (ce->ce_ctime.nsec != ST_CTIME_NSEC(*st)) > + changed |= CTIME_CHANGED; And here: + if (trust_ctime && check_stat && (ce->ce_ctime.nsec != ST_CTIME_NSEC(*st)) + changed |= CTIME_CHANGED;