-
Notifications
You must be signed in to change notification settings - Fork 327
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
preserve mtime when copying files #1026
Conversation
@raslop Thank you for the patch but I don't think it is a good idea to preseve mtime for all copy operations. Note |
Thanks for the feedback. I agree that this is a breaking change and that's not a good idea. This change was not meant to implement The next best thing is to add a configuration option, say
Well, not so hard (in my opinion), see above.
Hmm, I've tried that, but I didn't want to re-implement progress indication, which I like very much, in my custom command, just to get the mtimes preserved. I think adding a configuration option to preserve mtimes when copying (see above) is a good trade-off. |
@raslop There seems to be an example in the tips wiki page to show progress bar using I understand the benefit of preserving attributes in the builtin copy but I would rather have them all or at least a reasonable set of them implemented at the same time and keep them under a single option (e.g. If you like, we can keep the PR open for a while to attract others and maybe you or someone else can complete the work to a reasonable extent. |
Indeed, somehow I have missed that. This works indeed quite well.
Agreed.
I have to admit that's true. But unfortunately I'm not sure if that's possible with Preserving file-mode should be easy and straightforward (for what I have seen so far in the go library). Preserving ownership is only possible as super-user, but is not exposed by Preserving links is only applicable when copying multiple files where some of them are hard-linked (against others in the group to be copied). This is not possible to achieve in the
Fair enough. |
@raslop If you are going to work on this, feel free to take a look at times library which we already use in the code elsewhere. That can be useful for the timestamps if I'm not mistaken. Mode preserving might already be the case as we create the new file with the source file mode. If that's the case, we might think about implementing the opposite. If you get in doubt, feel free to use |
I've rebased to the current master and force-pushed the branch. I've added the suggested The basis is there and can be enhanced in the future, once it's portably possible. |
NB: The default value for the new @gokcehan: If you have some time, maybe you can have another look the the pull-request. |
@raslop Sorry, I had looked at the PR but I forgot to drop a reply. It looks good in general but I'm not sure |
@gokcehan I've chosen the |
@raslop Looks good, thanks for the patch. |
Fixes #869
Relates to #779