Re: [PATCH v2 3/3] core: convert build-time USE_NSEC into runtime core.useNanosec
Junio C Hamano <[email protected]>
| Newsgroups | org.kernel.vger.git |
|---|---|
| Message-ID | <[email protected]> |
"D. Ben Knoble" <[email protected]> writes: > -#ifdef USE_NSEC > - if (cfg->check_stat && sd->sd_mtime.nsec != ST_MTIME_NSEC(*st)) > - changed |= MTIME_CHANGED; > - if (cfg->trust_ctime && cfg->check_stat && > - sd->sd_ctime.nsec != ST_CTIME_NSEC(*st)) > - changed |= CTIME_CHANGED; > -#endif > + if (cfg->use_nanosec) { > + if (cfg->check_stat && sd->sd_mtime.nsec != ST_MTIME_NSEC(*st)) > + changed |= MTIME_CHANGED; > + if (cfg->trust_ctime && cfg->check_stat && > + sd->sd_ctime.nsec != ST_CTIME_NSEC(*st)) > + changed |= CTIME_CHANGED; > + } > > if (cfg->check_stat) { > if (sd->sd_uid != (unsigned int) st->st_uid || This is iffy. If you have core.usenanosec=true in a networked $HOME/.gitconfig mounted on both USE_NSEC-capable and incapable platforms, what would ST_CTIME_NSEC() yield on the latter? I wonder if cfg's '.use_nanosec' should be force-disabled in NO_NSEC builds, or something similar?