-
Notifications
You must be signed in to change notification settings - Fork 42
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
orgzly keeps syncing to a conflict branch even after the branch has been merged #237
Comments
I am currently testing a completely new git sync logic, so my memory of how the current logic works may be wrong, but I believe there is a bug which means that this will happen if you delete the conflict branch on the remote side before Orgzly has returned to the main branch. I think you need to resolve the conflict on the temp branch (i.e. merge main into it), leave it like that on the remote side, and trigger sync in Orgzly. Otherwise, Orgzly will simply push its view of the temp branch, and not attempt to return to the main branch. Once you're back on main, you can then safely delete the temp branch on the remote. This is of course confusing and bad, but it is solved in my ongoing overhaul of the git sync logic. Please try this and let me know if it works. |
Thanks for your reply. It does not work as it should; here is what happens I merge the conflict branch to master on my laptop, then push to the remote |
Sounds very strange indeed... If you look at the repo settings, is the main branch name correct? (See #29.) |
FYI, this is where you should end up in the code, but for some reason don't (or attemptReturnToMainBrach fails): https://github.com/orgzly-revived/orgzly-android-revived/blob/master/app/src/main/java/com/orgzly/android/git/GitFileSynchronizer.java#L318 But, as I was trying to express earlier, one known issue is that, if the current branch does not exist on the remote (because you have deleted the temp branch), you will end up here, and no attempt is done to return to the main branch: https://github.com/orgzly-revived/orgzly-android-revived/blob/master/app/src/main/java/com/orgzly/android/git/GitFileSynchronizer.java#L327 When you say you are receiving new changes on master, does the book status say "loaded from branch master"? Because that message means that the repo is on that branch. Any subsequent push of a temp branch should be a new one. |
No, |
Yes, the branch is "master". Always had been. |
I am seeing similar issues when rebasing master on top of Even though the merge branch can be fast-forwarded to master, either after a rebase or a merge, Orgzly creates a new merge branch. |
|
I probably figured out what was causing the issue for me (but I have no clue about how I ended up with that). I explored the Android repo with termux and found out that master had diverged from the remote (despite being on a conflict branch). Orgzly-revived was happily fetching updates from master and the conflict branch. But since master had diverged it refused to fast-forward. Since we were sitting on the conflict branch no action was taken, master was not in sync with the conflict and no "return to main branch" was happening. I manually merged master with the remote and then orgzly was happy. |
Yes. That makes sense. I am the end doing a rebase forces the other end to do a reset. I am using git-sync for my other devices which rebases as the default sync procedure. |
@wilderjds Interesting. I'd love to know how your master branch ended up in that diverged state... |
No idea tbh, but will report here if it happens again. Now that I found out that I can keep track of stuff in termux, it will be easier to see what is going on. |
Please complete the following information:
On a git repository, orgzly keep syncing to a merge-conflict branch even if the branch has been merged to master. No conflicts are present; I even removed the branch from the remote, but orgzly keeps creating it.
This has worked OK for some time but with the last conflict it is not resetting to master.
The text was updated successfully, but these errors were encountered: