In the company I work for, some users update their Gerrit changes from the web UI features (e.g. edit file content), resulting in new patch sets. It's easy, you don't have to edit, git add, git commit and git push...
However, the Git local copy does not have these new patch sets, and when pushing again from here, the already done edits may be lost or overridden.
Gerrit does not prevent this by default, which is normal, as there is no dependency between patch sets in the same Gerrit change (also seen here).
Is there any way of implementing such a thing, like always ensure the user pushes over the latest patch set? Gerrit custom hook, project accesses...
I.e. having the following behaviour:
- Change exists: latest patch set is 1/1
- Edit files from the web UI: latest patch set is 2/2 (Git local copy is not updated)
- Edit files from the not up-to-date Git local copy, and push: rejected
- Fetch the patch set 2/2, apply modifications and push again: latest patch set is 3/3.
Thanks guys!