-
Notifications
You must be signed in to change notification settings - Fork 91
Merge folders in decompression #798
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: tommady <[email protected]>
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.
Thanks for this PR! I never before considered this could be an option in the prompt instead of the default, it seems like a good idea so I'm thinking about letting that be.
Can you add a test that unpacks two archives with the following structures:
a/b/c/1
and
a/b/c/2
And show that when decompressed and provided m
via stdin, they will merge into:
a/
b/
c/
1
2
You can start from a copy of multiple_files_with_conflict_and_choice_to_rename
that uses the 'allow_piped_choice' feature flag (which we should someday turn into a flag), with that you can pass the stdin choice you want.
@@ -48,49 +48,71 @@ pub enum FileConflitOperation { | |||
/// Rename the file | |||
/// It'll be put "_1" at the end of the filename or "_2","_3","_4".. if already exists | |||
Rename, | |||
/// Merge duplicated files | |||
Merge, |
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.
We have a flag for always overwriting and a flag for always renaming, can you add a flag --merge
to always merge? (without asking the prompt).
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 guide me on which flag represents the always renaming?
because, from my understanding
flag --yes = always override
And yes, I can add a new flag in the decompress command to always merge.
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.
Huh I thought the rename PR added a flag for that... maybe it didn't
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.
hmmm, sorry, I read the question.rs deeply found out to add a new flag --merge we need to refactor the function pub fn user_wants_to_overwrite
which might be beyond the PR's scope.
So maybe we should create another PR to add
- --merge
- --overwrite
WDYT
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.
This is also on a good path for merging :) so don't forget a changelog entry, I think the PR title reflects this change well.
9ee3fd8
to
739dfa9
Compare
I am stuck on how to write the test. Thanks for your guidance. very appriceiate! |
Signed-off-by: tommady <[email protected]>
Signed-off-by: tommady <[email protected]>
Signed-off-by: tommady <[email protected]>
91103b1
to
2b9da1e
Compare
Signed-off-by: tommady <[email protected]>
Signed-off-by: tommady <[email protected]>
try to
close #466
close #727
I am very open-minded to accepting any suggestions.
The image below is just an example of fulfilling the purpose of those issues.