Skip to content

mv: add --exchange to atomically swap two paths#13215

Open
sylvestre wants to merge 3 commits into
uutils:mainfrom
sylvestre:mv-exchange
Open

mv: add --exchange to atomically swap two paths#13215
sylvestre wants to merge 3 commits into
uutils:mainfrom
sylvestre:mv-exchange

Conversation

@sylvestre

Copy link
Copy Markdown
Contributor

Should make test tests/mv/mv-exchange.sh pass

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/mv/mv-exchange is no longer failing!
Congrats! The gnu test tests/cp/link-heap is now passing!
Congrats! The gnu test tests/cut/cut-huge-range is now passing!

@codspeed-hq

codspeed-hq Bot commented Jun 29, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 90.94%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 6 regressed benchmarks
✅ 325 untouched benchmarks
⏩ 46 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

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

Open in CodSpeed

Footnotes

  1. 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.

  2. 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.

Comment thread tests/by-util/test_mv.rs
Comment thread tests/by-util/test_mv.rs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also test the scenario where source and target are the same file.

Comment thread tests/by-util/test_mv.rs
Should make test tests/mv/mv-exchange.sh pass
sylvestre added 2 commits July 5, 2026 14:15
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants