Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

More backups. Less history. How does that happen?

说明与用途

每次启动时自动备份的工具在合并内容相同的情况下可能会覆盖有用的历史记录。通过比较字节相同的内容来防止冗余备份,从而保留原始配置。

问题

Automated tools that create a backup on every launch can overwrite useful history when successive merges are identical, leading to a backup folder that contains only the latest version and no recoverable older settings.

结果

The patch prevents unnecessary backups when the merged content is byte‑identical, reducing backup count from ten to one and preserving the original configuration. However, formatting changes still produce new backups, indicating that deduplication is based on byte equality, not semantic changes.

工作流

  • 1. Start with an old configuration file.
  • 2. Merge a new setting into the file using the original code.
  • 3. Repeat the merge 27 times with identical content.
  • 4. Observe that 10 backup files are kept, all identical to the current file, and the original settings are lost.
  • 5. Apply the patch that compares the proposed output with the existing bytes before writing.
  • 6. Repeat steps 1–3 with the patched code.
  • 7. Observe that only one backup file is kept and the original settings survive.
  • 8. Run eight concurrent processes after the initial change to test lock protection.
  • 9. Verify that the patched version retains only the original backup while the original code retains nine backups of the new content.
  • 10. Perform deliberate formatting rewrites to test byte‑identical detection.
  • 11. Observe that both versions keep ten backups and lose the original settings when formatting changes bytes.

证据

Before the patch, later merges kept saving the new settings again until the first backup fell outside the ten-file window.

来源

After the patch, unchanged merges stopped consuming that window. Fewer backup files preserved more useful history.

来源

We also ran eight concurrent processes after the initial change. The old version retained nine backups; the patched version retained only the original old content.

来源

  • 记录日期: 2026-09-21T11:30:23.627Z