1

I always want to have a review on top of the newest master which means that when I update the gerrit review I have to run two commands:

git rebase origin/master && git review

Is there a way to convince gerrit (review) to do it by itself?

sorin
  • 161,544
  • 178
  • 535
  • 806

2 Answers2

2

You don't need to run the "git rebase" because "git review" already automatically performs the rebase before submitting the change to Gerrit. If you want to bypass the rebase execution use the -R (--no-rebase) option. To see more info about this execute "man git-review" and search for "-R".

  • I can assure you that the rebase did not happen automatically in my case. I don't really know why because I see no special option inside the `.gitreview` file. – sorin Dec 02 '16 at 17:45
  • Have you checked if your git-review version (git review --version) works that way? – Marcelo Ávila de Oliveira Dec 02 '16 at 18:23
  • `git-review version 1.25.0` -- please note that I use several times during the development of the correct patch. This may take days and almost for sure the master will receive new commits and I don't want to miss them. – sorin Dec 03 '16 at 12:10
  • It's expected to have automatic rebase with 1.25.0. Have you set gitreview.branch in .gitreview file? – Marcelo Ávila de Oliveira Dec 03 '16 at 20:41
0

So far I was able to overcome this by adding this alias:

alias grr='git rebase origin/master && git review'

The grr comes from git-rebase-review ... in case it was not obvious ;)

sorin
  • 161,544
  • 178
  • 535
  • 806