Page MenuHomePhabricator

Git 2.15: "git review -d" is broken since "-set-upstream" got removed
Closed, ResolvedPublic

Description

"git review -d" includes a call to "git branch --set-upstream-to", an option that has been deprecated since git 1.8 and was now removed in git 2.15.0[0], the latest git version released two weeks ago [1]. Thus, when using "git review -d", I get:

eddie@eddie-thinkpad:~/develop/mediawiki (master)$ git review -d 352646
Downloading refs/changes/46/352646/11 from gerrit
Cannot set upstream to remote branch
The following command failed with exit code 128
    "git branch --set-upstream review/eddiegp/site_stats origin/master"
-----------------------
fatal: the '--set-upstream' option is no longer supported. Please use '--track' or '--set-upstream-to' instead.
-----------------------

[0] https://github.com/git/git/blob/master/Documentation/RelNotes/2.15.0.txt#L21
[1] https://github.com/git/git/releases/tag/v2.15.0

Event Timeline

Hi, this is a git-review tool that is owned and maintained by openstack. See https://github.com/openstack-infra/git-review

You may want to contribute the patch there as this tool is not maintained or has been created by gerrit upstream :).

https://github.com/openstack-infra/git-review/blob/b61f5b2ec9ab140960a1c6e0a424389cdd8951a0/git_review/cmd.py#L1231

https://github.com/openstack-infra/git-review/search?utf8=✓&q=set+upstream&type=

I just noticed there already is a patch for this at https://review.openstack.org/#/c/517831/

Merging that patch will be the first step to resolve this. However, it seems nobody does releases of git-review nowadays. We will need to either beat them until somebody does a release or document that git-review needs to be built from source now (and how to do that). The latter of which shouldn't become more that a short-term solution, as it may raise the barrier for new contributors even more.

it seems nobody does releases of git-review nowadays

How about asking the maintainer of the Debian package? Which is.. the openstack-devel list.

Maintainer: PKG OpenStack <openstack-devel@lists.alioth.debian.org>

If I can plug one of my own tools: https://github.com/legoktm/grr. It's pretty simple to use, but has a different model of development as it relies on detached HEADs and not branches.

Whilst at it should we fix that issue with having a base url for https clones? Base url as in /r as many users are having issues with it trying /changes/ instead of /r/changes/?

Aklapper renamed this task from "git review -d" is broken to Git 2.15: "git review -d" is broken since "-set-upstream" got removed.Nov 15 2017, 11:08 AM

I wonder where that comes from since i have used git review for many many years and don't remember ever having that issue you are referring too, Paladox.

@Dzahn there’s a task around some where but there have been many tasks. Even been asked privately about it.

I can look for the task later but may be harder to find if it was declined?

If I can plug one of my own tools: https://github.com/legoktm/grr. It's pretty simple to use, but has a different model of development as it relies on detached HEADs and not branches.

I've got this super awesome tool, you might already have it installed. It's pretty easy to use and doesn't rely on an absentee upstream like git-review. It's called git.

I just noticed there already is a patch for this at https://review.openstack.org/#/c/517831/
Merging that patch will be the first step to resolve this.

This has happened meanwhile. "Support git 2.15 and newer" has been merged upstream. :)

Upstream are planning on releasing a new version soon :).

They may also include a fix for this T154760

EddieGP claimed this task.

git-review 1.26 (containing the fix) was released a few days ago. The new version is available from pypi (https://pypi.python.org/pypi/git-review). Naturally it'll take a while for distribution packages to update.

Thanks. Please do try it and report back that it’s fixed :)

Thanks. Please do try it and report back that it’s fixed :)

It is, that's why I closed the task ;-)

eddie@eddie-thinkpad:~/develop/mediawiki/extensions/ThrottleOverride (master)$ git review --version
git-review version 1.26.0
eddie@eddie-thinkpad:~/develop/mediawiki/extensions/ThrottleOverride (master)$ git review -d 392556
Downloading refs/changes/56/392556/4 from gerrit
Switched to branch "review/bryandavis/392556"