gerrit push throws "change is closed" error

1,170 views
Skip to first unread message

pythong beginner

unread,
Jul 30, 2018, 1:53:42 PM7/30/18
to Repo and Gerrit Discussion
Hi

I am getting the below error while trying to push a gerrit to our gerrit server,Firstly I understand why I am getting this error,am trying to upload a gerrit with the same change-id as the closed one onto another branch, thats why am getting the error I think, my questions are as follows

1.Why is this not allowed to have same change-id in the first place across different branches?When I look at the gerrits or try to cherrypick from gerrit UI ,it does allow 

2.Is there a way to fix this on the gerrit side?

remote: Processing changes: (\)
remote
: Processing changes: (|)
remote
: Processing changes: (/)
remote: Processing changes: (-)
remote: Processing changes: refs: 1 (-)
remote: Processing changes: refs: 1, done            
remote: 2018-07-38 31:35:36 commit-received <module>                       64     INFO    : ['/gerrit_v3/hooks/commit-received', '--project', 'tech-ci', '--refname', 'refs/heads/milestone2', '--uploader', 'FIRSTNAME LASTNAME <user...@company.com>', '--oldrev', '385c756a3d48f43214ca2201f4e74213f011640f', '--newrev', '0c3c27b631a4b141a827e63d5f2318633122f621', '--cmdref', 'refs/for/milestone2%r=user...@company.com']        
remote: 2018-07-38 31:35:36 commit-received <module>                       88     INFO    : logging onto system        
remote:
remote:
remote: Branch:milestone2        
remote: commit 0c3c27b631a4b141a827e63d5f2318633122f621        
remote: Author: FIRSTNAME LASTNAME <user...@company.com>        
remote: Date:   Fri Feb 16 11:13:47 3018 -0800        
remote:
remote:     <change:/
/problem/43622452>[milestone ]Dummy changesystem        
remote
:            
remote
:     Change-Id: Iccf0bf30fd86033b186da8d12d340e7b321d25d4        
remote
:     Reviewed-on: https://tech-gerrit.sd.company.com/16536        
remote
:     Reviewed-by: tech Gerrit <CIUser@company.com>        
remote
:     Tested-by: tech Gerrit <CIUser@company.com>        
remote
:     (cherry picked from commit 70dd117ef125bbfacd020c1a7db5ec3e31cd47b6)        
To ssh://tech-gerrit.sd.company.com:32418/tech-ci
! [remote rejected] HEAD -> refs/for/milestone2%r=username@company.com (change https://tech-gerrit.sd.company.com/16557 closed)
error
: failed to push some refs to 'ssh://user...@tech-gerrit.sd.company.com:32418/tech-ci'

Gert van Dijk

unread,
Jul 31, 2018, 3:08:47 AM7/31/18
to Repo and Gerrit Discussion
On Monday, 30 July 2018 19:53:42 UTC+2, pythong beginner wrote:
1.Why is this not allowed to have same change-id in the first place across different branches?When I look at the gerrits or try to cherrypick from gerrit UI ,it does allow 

2.Is there a way to fix this on the gerrit side?

I believe you might be looking for the project/repository-level setting labeled "Create a new change for every commit not in the target branch" - you can set this from the UI as project owner/admin. I believe that what happens basically, is that it considers Change-Ids on a per-target-branch namespace. Like other settings, you can set this on the top level (e.g. All-Projects) and let other projects/repositories inherit from it to make it a global setting.

HTH

pythong beginner

unread,
Aug 1, 2018, 6:26:36 PM8/1/18
to gert...@gmail.com, repo-d...@googlegroups.com
I am not sure that applies here , I have that setting for "Create a new change for every commit not in the target branch" as "Inherit(False)" already but look at https://gerrit-review.googlesource.com/Documentation/project-configuration.html#_use_target_branch_when_determining_new_changes_to_open that setting is using during MERGE context not during cherry-pick 

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to a topic in the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/repo-discuss/-iIFGe2Tckg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gert van Dijk

unread,
Aug 1, 2018, 7:41:26 PM8/1/18
to Repo and Gerrit Discussion
On Thursday, 2 August 2018 00:26:36 UTC+2, pythong beginner wrote:
I am not sure that applies here , I have that setting for "Create a new change for every commit not in the target branch" as "Inherit(False)" already but look at https://gerrit-review.googlesource.com/Documentation/project-configuration.html#_use_target_branch_when_determining_new_changes_to_open that setting is using during MERGE context not during cherry-pick

I have read your message from the beginning and I still believe this option does apply here. Also, you mention it's currently at False for your project. Try setting it to True instead (that's what I tried to suggest).

Also, I think neither the submit type of the project, nor the way the commit has been created locally (cherry-pick or copy Change-Id or whatever) have any influence on the behavior of that setting. (The documentation is referring to the merge base as a push option, that's something else than the base of a merge commit.)

HTH

pythong beginner

unread,
Aug 11, 2018, 12:05:16 AM8/11/18
to Repo and Gerrit Discussion
Wouldn't setting it to "TRUE" force to create a new change-id on the target branch which is exactly what I do _not_ want....I want the change-id to be the same across branches....

Jonathan Nieder

unread,
Aug 11, 2018, 12:09:05 AM8/11/18
to pythong beginner, Repo and Gerrit Discussion
> Wouldn't setting it to "TRUE" force to create a new change-id on the target branch which is exactly what I do _not_ want....

No. It would cause Gerrit to open a new change each time you push the commit to a new refs/for/<target> branch. Try it.

Ideas for clarifying the docs?

Thanks,
Jonathan

пт, 10 авг. 2018 г. в 21:05, pythong beginner <python.b...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.

pythong beginner

unread,
Aug 11, 2018, 12:15:15 AM8/11/18
to Repo and Gerrit Discussion
Hi Jonathan:

>It would cause Gerrit to open a new change each time you push the commit to a new refs/for/<target> branch.
  open a new change with the same change-id as the source branch,right?

Jonathan Nieder

unread,
Aug 11, 2018, 12:18:09 AM8/11/18
to pythong beginner, Repo and Gerrit Discussion
>> It would cause Gerrit to open a new change each time you push the commit to a new refs/for/<target> branch.
>
>  open a new change with the same change-id as the source branch,right?

Yes, correct. I encourage you to try it, since seeing is believing.

Thanks,
Jonathan

пт, 10 авг. 2018 г. в 21:15, pythong beginner <python.b...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages