rsync.nvim icon indicating copy to clipboard operation
rsync.nvim copied to clipboard

Allow to control flags of the rsync command

Open Dimfred opened this issue 1 year ago • 6 comments

Would be nice to have this, e.g. I sometimes don't want --delete to be called, since it would clear my build folder (only if it is not in the .gitignore) on the remote. I think this could maybe give some more flexibility?

What do you think of having a function one can set, that function receives the project_path, and the destination_path (per command, RsyncUp RsyncDown...) and the user could build his own string and else the default could be provided.

I am still looking at the code, but I think that would be a very flexible approach. Love the idea btw if I haven't said it yet, and thank you for writing it <3

Dimfred avatar Jun 16 '23 19:06 Dimfred

Hmm. I have to think about this one. I have #29 where you then could just add an ignore file to ignore the build folder.

Also could you explain the reason for not having the build folder on the ignore file?

OscarCreator avatar Jun 17 '23 06:06 OscarCreator

There was none, i just forgot to add it and wiped the remote. I think there could be usecases maybe and just don't have one yet, also it would solve the other problem with the different rsync versions, since everyone could just use their own command.

I think it depends on how you want the plugin to be, completely work out of the box, or make it more configurable. I normally prefer the latter. All power to the user.

Dimfred avatar Jun 17 '23 07:06 Dimfred

Generally I want it to work out of the box but still be easy to extend if needed.

OscarCreator avatar Jun 17 '23 14:06 OscarCreator

Okay so, I just wiped my whole remote folder, because I set the wrong path, I would really like to disable --delete on my end. Obviously my error, but still could have been mitigated.

Dimfred avatar Jun 23 '23 07:06 Dimfred

Okay, sure we could add this. But I can tell you the reason why it's there. Say you have a git repo synced up to a remote and I delete a file locally. That file will still exist on the remote side.

If I for example have multiple git branches locally (which adds or removes files) then the remote will be a mess with lots of files not representing the local state.

OscarCreator avatar Jun 23 '23 14:06 OscarCreator

Don't get me wrong, I see that thats an issue and I think delete makes sense, but e.g. I probably would create myself a custom command for deletions, and run deletions manually, I just want to decide when I do that.

Dimfred avatar Jun 24 '23 08:06 Dimfred