cp: correct --verbose --parents output for both files and directories#4184
Merged
sylvestre merged 2 commits intouutils:mainfrom Dec 12, 2022
Merged
cp: correct --verbose --parents output for both files and directories#4184sylvestre merged 2 commits intouutils:mainfrom
sylvestre merged 2 commits intouutils:mainfrom
Conversation
9d904f6 to
3d08c6b
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
Contributor
|
I guess the GNU regression is legit. could you please have a look? |
Collaborator
Author
|
I think it is related to #3894 (comment) I will take a look. |
1b1f677 to
168837c
Compare
Collaborator
Author
|
Okay, I've made a change to the second commit in this branch. By adding this condition: if source_absolute.is_dir()
&& !ends_with_slash_dot(&source_absolute)
&& !local_to_target.exists()
{it should also fix #3897. |
|
GNU testsuite comparison: |
Collaborator
Author
|
I broke things by introducing some code to set the current working directory of the child process produced by |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
This commit corrects the behavior of `cp --parents --verbose` when the
source path is a file so that it prints the copied ancestor
directories. For example,
$ mkdir -p a/b d
$ touch a/b/c
$ cp --verbose --parents a/b/c d
a -> d/a
a/b -> d/a/b
'a/b/c' -> 'd/a/b/c'
Fixes uutils#3332.
This commit corrects the behavior of `cp -r --parents --verbose` when
the source path is a directory, so that it prints the copied ancestor
directories. For example,
$ mkdir -p a/b/c d
$ cp -r --verbose --parents a/b/c d
a -> d/a
a/b -> d/a/b
'a/b/c' -> 'd/a/b/c'
This file contains hidden or 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
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.
This pull request corrects the behavior of
cp --parents --verbosewhen the source path is a file and when the source path is a directory so that it prints the copied ancestor directories. For example,And
Fixes #3332.