-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Bug] yarsync push
overwrite uncommitted modified files on the remote
#9
Comments
Hey @r888800009 , thanks for your pull request and bug report.
Otherwise seeing "uncommitted changes" on the remote would mean to compare (push data) between two remote folders. Do you have an idea on how it could be implemented?.. With |
Thanks for your reply, I have some ideas to discuss. Run local test on the remote serverThe first idea, if we expect remote to also install There is a hacky way to use For example, we can run sleep on the remote server with
One possible solution is to use the rsync error message to detect whether the local test was successful.
We can compare the difference between these two outputs In this case, it would be better to use the ssh command to avoid hacky code. The disadvantage is assumed the remote repo user uses rsync through ssh. Dry run as default behaviorAnother idea is to run dry-run checking by default when remote push, and the user can set the configuration like This may be useful for new users to avoid accidental overwriting. If we always run Bare RepositoryThere is also something like git bare repository, which is divided into multiple repo, one is bare for sync between computers, but I have not tried it with yarsync. If it is a possible solution, maybe users can refer to it. |
Thanks for the ideas. They are all rather nice. Run local test on the remote serverYes, this should work. Since
shall print the status. Dry run as default behaviorYes, this might be useful. Bare RepositoryThere is a kind of a "bare" repository (with detached working and configuration directories), but it is different. There are indeed several options to deal with this problem, that's why I'm not sure yet which one to apply. In general yes, it would be good (namely safe) to test for uncommitted changes. For me, I try to always commit my changes. Also, the files in yarsync repositories are usually not crucial for me (and if they are, I carefully look at the results of dry run - and I synchronise important repositories rarely; I don't update them often). What is your situation (working routine)? What kind of files do you use? Do you really use a server and add files there? Maybe a better solution exists. |
Hello, I am looking for a synchronization tool similar to git but that can handle FS metadata (timestamp), and found your project that seems to be a good match. Now I am trying to evaluate whether it is suitable for my use case.
But when push, that some data that has not yet been committed will be overwritten.
Version
yarsync version 0.2.1
Operating System
macos ventura and archlinux
What happened
We have two computers
A
andB
, create a repo, create afile1
and commit.And make sure that
A
andB
each have a copy of the repo.Then modify
file1
onB
then push fromA
, we can see that thefile1
has been overwritten.How to reproduce
init repo
then push repo from A to B, and make
file1
push againModify
file1
on BThen push from A again, We can see that the file is overwritten
What you think should happen instead
yarsync
should detect and avoid overwriting data, shows that the remote has not yet committed.If this is not the intended use, it must be aborted to avoid data loss.
The text was updated successfully, but these errors were encountered: