Skip to content

Comments

mv: use GNU default error when overwriting non-empty directory#10078

Open
aaron-ang wants to merge 1 commit intouutils:mainfrom
aaron-ang:mv-msg
Open

mv: use GNU default error when overwriting non-empty directory#10078
aaron-ang wants to merge 1 commit intouutils:mainfrom
aaron-ang:mv-msg

Conversation

@aaron-ang
Copy link
Contributor

@aaron-ang aaron-ang commented Jan 5, 2026

Closes #5102.

The GNU default mv error message: cannot overwrite {target}: Directory not empty, is clear enough for the case of overwriting non-empty directory. It clearly states the overwrite intent and that target is the empty directory.

Our current message: cannot move {source} to {target}: Directory not empty, is causing confusion (see #5102 (comment)) and should be reverted.

In addition, I made test cases stricter by expecting stderr only and replaced some comments with full expected errors.

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

GNU testsuite comparison:

GNU test failed: tests/mv/dir2dir. tests/mv/dir2dir is passing on 'main'. Maybe you have to rebase?

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

GNU testsuite comparison:

GNU test failed: tests/mv/dir2dir. tests/mv/dir2dir is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@aaron-ang aaron-ang changed the title mv: improve error message when overwriting non-empty directory mv: revert error message to GNU default when overwriting non-empty directory Jan 5, 2026
@aaron-ang aaron-ang changed the title mv: revert error message to GNU default when overwriting non-empty directory mv: use GNU default error when overwriting non-empty directory Jan 5, 2026
@github-actions
Copy link

github-actions bot commented Jan 5, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/sort/sort-debug-keys. tests/sort/sort-debug-keys is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/env/env-signal-handler is now passing!

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 22, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing aaron-ang:mv-msg (0121dce) with main (d2bd2d3)

Summary

✅ 142 untouched benchmarks
⏩ 180 skipped benchmarks1

Footnotes

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

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)

@aaron-ang
Copy link
Contributor Author

#10435 should fix the CI errors.

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)

@aaron-ang
Copy link
Contributor Author

hi @sylvestre, could you please take a look at this?

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.

mv: error message "Directory not empty" is confusing

1 participant