Description
Current behavior 😯
gitoxide/gix/src/config/cache/util.rs
Lines 19 to 25 in d0ef276
We just ran into our tests failing in Jujutsu only on release builds, because our snapshots of the generated configuration suddenly lost all their whitespace. I was briefly wondering if some kind of bizarre compiler bug might be involved.
Expected behavior 🤔
Please reconsider this behaviour!
Release builds should not affect functionality, only performance and the presence of debug checks. Any behavioural change should be handled through feature flags. (From a quick search,
gitoxide/gix-transport/src/client/blocking_io/http/mod.rs
Lines 300 to 305 in d0ef276
But really, I think modifying repository configuration with gix
and writing it back out again should not silently throw away user data in general, even with a feature flag. If it affects lookup performance I think using a different data structure is the correct approach, not stripping out whitespace and comments.
Git behavior
Git doesn’t clobber configuration in this way.
Steps to reproduce 🕹
https://gist.github.com/demize/8a468be11b3b19069efca37323c352a2#file-minimum-reproducible-example-rs is not a minimal reproducer (just taking a snapshot and writing it back out suffices), but it works to demonstrate the problem.