HomePhabricator

For errors on `refs/publish/...`, warn about too old git-review

Authored by QChris on Jul 2 2020, 3:06 PM.

Description

For errors on refs/publish/..., warn about too old git-review

While we removed support for magic refs/publish/... branches some
time ago, there are still lots of git-review users in the wild that use
an old git-review that relies on refs/publish/... (i.e.: git-review
before 1.27). Their git-review fails with error messages like:

remote: error: branch refs/publish/master:
remote: use a SHA1 visible to you, or get update permission on the ref
remote: User: <redacted>
remote: Contact an administrator to fix the permissions

and

remote: error: branch refs/publish/master:
remote: You need 'Create' rights to create new references.
remote: User: <redacted>
remote: Contact an administrator to fix the permissions

which are of little use for them.

Since old git-review versions are still so popular with users, we add a
hint towards upgrading their git-review, upon errors on
refs/publish/.... So error messages for users of a too old git-review
now look like

remote: error: branch refs/publish/master:
remote: If you are using git-review, update to at least git-review 1.27. Otherwise:
remote: use a SHA1 visible to you, or get update permission on the ref
remote: User: <redacted>
remote: Contact an administrator to fix the permissions

To see how popular old git-review versions still are with users,
consider Wikimedia's Gerrit upgrade. They had a few bugs reports about
this issue, a few more pastebins, where users complained, and at least
a dozen of cases where people complained in IRC. All within first five
days after migration.

Co-Author: Kunal Mehta <legoktm@member.fsf.org>
Change-Id: Ia121a90f229e4044b2514132346719fcb8096e9c