Replies: 1 comment 1 reply
-
There will always be a possible race condition as we cannot lock the remote repository. Doing So you should not be updating manually but configure webhooks to make sure Weblate gets instant notifications when the remote repository changes and follows it automatically. See https://docs.weblate.org/en/latest/admin/continuous.html#updating-repositories |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the issue
The "Squash Git commits" add-on is trying to first rebase the local commits onto the
origin
remote, but the check to see whether it should is not using up-to-date information. This causes the plugin to squash the commit already on the remote with its last local commits. This in turn causes a merge conflict on the next rebase.I already tried
Steps to reproduce the behavior
Prerequisites:
main
and push branchweblate
(that are exactly the same at this point). Have it track a folder containing.po
files and a.pot
file. Disable the "Push on commit" setting.weblate
branch.main
branch outside of Weblate.At this point, a merge conflict occurs and everything is locked.
What happens is, after step 4, Weblate is not aware yet that your
main
branch (that it's tracking) has the same commit as Weblate commited before. It's one commit behind. When you change a translation and commit again, thepost_commit
hook of the "Squash Git commits" add-on executes, which checks:weblate/weblate/addons/git.py
Lines 254 to 263 in 992f32a
However, the
repo_needs_merge()
function just does agit log --format=format:%H ..origin/main --
, which lists the commits on the remote that are not in the local repo. At this point it doesn't do agit fetch
first, so it still has an old view of theorigin/main
branch that didn't contain its previous commit. So it does not rebase and squashes its new commit with the previous one (that is already on our remote).When we try to do a real rebase afterwards, it gives a merge conflict.
Expected behavior
The check to rebase does a
git fetch
on the remote first before doing thegit log
command. Or another solution that makes sure it is up to date.How do you run Weblate?
Docker container
Beta Was this translation helpful? Give feedback.
All reactions