new flag: Enable renaming during file upload if duplicate exists#1453
new flag: Enable renaming during file upload if duplicate exists#1453svenstaro merged 2 commits intosvenstaro:masterfrom
Conversation
|
I also thought about just renaming when |
|
Thanks for this! I'd really like to see some tests here, though. It just occurred to me that we have no tests for conflicting files without any flags set nor did we have one for
I think we want an error here by default. It's safer.
I do like the enum idea. I'm fine breaking compatibility here. We have to make sure it's well pointed out in the CHANGELOG so people can quickly spot it. |
|
Thanks for the review, I'll push with the tests once I have a bit more free time. |
|
I have added the tests for the three conditions mentioned previously. I copied the tests from the |
|
@Atreyagaurav Looking great! What do you think about the enum thing that we discussed above? |
|
I added it as enum, and made the default be error. So only breaking change is I have the tests updated as well. And I also manually tested. |
|
Hey, I'd like to get this into the next release if possible. Could you rebase this and then it should be good to merge? |
|
Hi, it looks like a lot of things were changed while doing the multipart file upload. Would have been nice to merge it before that. I'll have to look into the conflicts a little more deeply and understand the new process as well, do you think you can wait like a week for it? |
Yeah, sorry about that. Life happened. Anyway, I can certainly wait a week. :) |
|
Hey, @Atreyagaurav, do you think we can push this over the finish line soon? |
|
Since there were conflicts and other changes in master, I just redid everything on the new master and force-pushed. Should be fine. For the tests, I took the examples from other tests in the |
svenstaro
left a comment
There was a problem hiding this comment.
I think we're super close now. Sorry for taking some time to re-review this.
Co-authored-by: Sven-Hendrik Haase <[email protected]>
|
The clippy error has a lot of problems from other codes besides the one I changed as well. We could use I didn't get the error locally, so there's probably changes in clippy for this to be an error now. |
|
Please rebase, I made clippy happy on master! |
|
Whoops. |
|
Thanks! I'll merge this as is. |
|
Thank you! Sorry I was in a meeting and couldn't rebase. |
Fixes #1452
I think this will work as a flag to rename files. It won't work when the file contains multiple extension like
.tar.gzwhich is hard to do, as we could make it work with that, but any file with multiple.in the text for no meaning will mess it up. But I can make that change if you think that's acceptable.Also, it will break compatibility, but we could combine the overwrite and rename flags into a single flag like
--duplicate-filesthat takes enum (rename/overwrite).