-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mv: improve move-to-self error handling #6995
Open
sgvictorino
wants to merge
1
commit into
uutils:main
Choose a base branch
from
sgvictorino:improve-mv-to-self-errors
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+130
−111
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sgvictorino
force-pushed
the
improve-mv-to-self-errors
branch
from
December 23, 2024 21:36
b0ef406
to
5af8055
Compare
GNU testsuite comparison:
|
sgvictorino
force-pushed
the
improve-mv-to-self-errors
branch
3 times, most recently
from
December 24, 2024 03:49
7f5d2d2
to
c983180
Compare
GNU testsuite comparison:
|
sgvictorino
force-pushed
the
improve-mv-to-self-errors
branch
from
December 24, 2024 04:22
c983180
to
2425ccc
Compare
GNU testsuite comparison:
|
sgvictorino
force-pushed
the
improve-mv-to-self-errors
branch
2 times, most recently
from
December 24, 2024 17:49
3ce0134
to
ddbb07b
Compare
GNU testsuite comparison:
|
- improve move-to-self detection, so this errors without data loss: ```diff mkdir mydir mv mydir mydir/subdir -mv: No such file or directory (os error 2) +mv: cannot move 'mydir' to a subdirectory of itself, 'mydir/subdir' ``` - align "cannot move source to a subdirectory of itself" and "same file" errors more closely with coreutils: ```diff mkdir mydir mv mydir/ mydir/.. -mv: cannot move 'mydir/' to a subdirectory of itself, 'mydir/../mydir/' +mv: 'mydir/' and 'mydir/../mydir' are the same file ```
sgvictorino
force-pushed
the
improve-mv-to-self-errors
branch
from
December 24, 2024 20:21
ddbb07b
to
f104ba0
Compare
GNU testsuite comparison:
|
is there a bug somewhere or it is just something you identified ? |
sylvestre
reviewed
Dec 26, 2024
) -> UResult<()> { | ||
let target_is_dir = target_is_dir && !opts.no_target_dir; | ||
|
||
let canonicalized_source = match canonicalize( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please add some comments explaining the different cases ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
errors more closely with coreutils: