Bug 2039224

Summary: git-review is broken with git 2.34+
Product: [Fedora] Fedora Reporter: Dmitry Tantsur <dtantsur>
Component: git-reviewAssignee: Pete Zaitcev <zaitcev>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 35CC: fserucas, ltoscano, rpittau, zaitcev
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: git-review-2.2.0-1.fc35 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2063790 2188001 (view as bug list) Environment:
Last Closed: 2022-02-19 01:31:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2063790, 2188001    

Description Dmitry Tantsur 2022-01-11 10:03:37 UTC
$ git review
Errors running git rebase -p -i remotes/gerrit/master
fatal: --preserve-merges was replaced by --rebase-merges
It is likely that your change has a merge conflict. You may resolve it
in the working tree now as described above and then run 'git review'
again, or if you do not want to resolve it yet (note that the change
can not merge until the conflict is resolved) you may run 'git rebase
--abort' then 'git review -R' to upload the change without rebasing.

See https://bugs.archlinux.org/task/73058 for an explanation. Needs updating to include https://opendev.org/opendev/git-review/commit/7182166ec00ad3645821435d72c5424b4629165f.

git-review-1.28.0-10.fc35.noarch
git-2.34.1-1.fc35.x86_64

Comment 1 Dmitry Tantsur 2022-01-11 10:07:25 UTC
Note that git-review 2.2.0 actually includes the fix. 1.28.0 is from 2019, so an update is overdue.

Comment 2 Dmitry Tantsur 2022-01-11 10:09:52 UTC
diff --git a/git_review/cmd.py b/git_review/cmd.py
index b248b46..c264eb7 100644
--- a/git_review/cmd.py
+++ b/git_review/cmd.py
@@ -852,9 +852,9 @@ def rebase_changes(branch, remote, interactive=True):
         sys.exit(1)
 
     if interactive:
-        cmd = "git rebase -p -i %s" % remote_branch
+        cmd = "git rebase --rebase-merges -i %s" % remote_branch
     else:
-        cmd = "git rebase -p %s" % remote_branch
+        cmd = "git rebase --rebase-merges %s" % remote_branch
 
     (status, output) = run_command_status(cmd, GIT_EDITOR='true')
     if status != 0:

Comment 3 Pete Zaitcev 2022-01-11 19:35:15 UTC
Indeed, we're behind with packaging of 2.2.0. Worse, the whole shebang needs to be fast-tracked for the benefits of CentOS etc.

See this PR
https://src.fedoraproject.org/rpms/git-review/pull-request/3

Comment 4 Francisco Seruca Salgado 2022-01-20 11:09:43 UTC
Hi Dmitry Tantsur,

I had the same issue, a temporary fix is to downgrade your git version.

Comment 5 Fedora Update System 2022-02-11 16:12:54 UTC
FEDORA-2022-d807d9cd76 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-d807d9cd76

Comment 6 Fedora Update System 2022-02-12 01:39:36 UTC
FEDORA-2022-d807d9cd76 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-d807d9cd76`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-d807d9cd76

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2022-02-19 01:31:42 UTC
FEDORA-2022-d807d9cd76 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.