Skip to content

Commit

Permalink
trust Ctime again
Browse files Browse the repository at this point in the history
It seems to work now, but let's keep an eye on it.
  • Loading branch information
Byron committed Oct 5, 2023
1 parent 46e5919 commit f929d42
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
8 changes: 1 addition & 7 deletions gix/src/config/cache/access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,7 @@ impl Cache {
pub(crate) fn stat_options(&self) -> Result<gix_index::entry::stat::Options, config::stat_options::Error> {
use crate::config::tree::gitoxide;
Ok(gix_index::entry::stat::Options {
trust_ctime: boolean(
self,
"core.trustCTime",
&Core::TRUST_C_TIME,
// For now, on MacOS it's known to not be trust-worthy at least with the Rust STDlib, being 2s off
!cfg!(target_os = "macos"),
)?,
trust_ctime: boolean(self, "core.trustCTime", &Core::TRUST_C_TIME, true)?,
use_nsec: boolean(self, "gitoxide.core.useNsec", &gitoxide::Core::USE_NSEC, false)?,
use_stdev: boolean(self, "gitoxide.core.useStdev", &gitoxide::Core::USE_STDEV, false)?,
check_stat: self
Expand Down
3 changes: 1 addition & 2 deletions gix/src/config/tree/sections/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ impl Core {
/// The `core.symlinks` key.
pub const SYMLINKS: keys::Boolean = keys::Boolean::new_boolean("symlinks", &config::Tree::CORE);
/// The `core.trustCTime` key.
pub const TRUST_C_TIME: keys::Boolean = keys::Boolean::new_boolean("trustCTime", &config::Tree::CORE)
.with_deviation("Currently the default is false, instead of true, as it seems to be 2s off in tests");
pub const TRUST_C_TIME: keys::Boolean = keys::Boolean::new_boolean("trustCTime", &config::Tree::CORE);
/// The `core.worktree` key.
pub const WORKTREE: keys::Any = keys::Any::new("worktree", &config::Tree::CORE)
.with_environment_override("GIT_WORK_TREE")
Expand Down
2 changes: 1 addition & 1 deletion src/plumbing/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ pub fn main() -> Result<()> {
core::repository::status::Options {
format,
statistics,
thread_limit: thread_limit.or(cfg!(target_os = "macos").then_some(3)), // TODO: make this a configurable when in `gix`, this seems to be optimal on MacOS, linux scales though!
thread_limit: thread_limit.or(cfg!(target_os = "macos").then_some(3)), // TODO: make this a configurable when in `gix`, this seems to be optimal on MacOS, linux scales though! MacOS also scales if reading a lot of files for refresh index
allow_write: !no_write,
submodules: match submodules {
Submodules::All => core::repository::status::Submodules::All,
Expand Down

0 comments on commit f929d42

Please sign in to comment.