mv: add --exchange to atomically swap two paths#13215
Conversation
|
GNU testsuite comparison: |
Merging this PR will degrade performance by 90.94%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | sort_ascii_c_locale |
16.7 ms | 1,723.3 ms | -99.03% |
| ❌ | Simulation | sort_ascii_utf8_locale |
16.1 ms | 1,274.4 ms | -98.73% |
| ❌ | Memory | sort_ascii_c_locale |
4.6 MB | 81.8 MB | -94.37% |
| ❌ | Memory | sort_ascii_utf8_locale |
4.6 MB | 52.4 MB | -91.21% |
| ❌ | Simulation | mv_force_overwrite |
62.8 ms | 66 ms | -4.84% |
| ❌ | Simulation | mv_single_file |
62.6 ms | 65.4 ms | -4.26% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing sylvestre:mv-exchange (8015178) with main (2c2f1b0)2
Footnotes
-
46 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
main(32952d8) during the generation of this report, so 2c2f1b0 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
There was a problem hiding this comment.
I would also test the scenario where source and target are the same file.
Should make test tests/mv/mv-exchange.sh pass
Matches GNU mv: 'mv --exchange a b c dir/' exchanges each source with the file of the same name inside dir/. Also add a same-file check (mirroring regular mv's behavior) and strengthen existing exchange tests with actual error-message assertions, per review feedback.
Should make test tests/mv/mv-exchange.sh pass