My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 2130: "Cherry Pick To" allows passing through of changes without a Change-Id
4 people starred this issue and may be notified of changes. Back to list
Status:  Released
Owner:  ----
Closed:  Sep 2013


Sign in to add a comment
 
Reported by krinklemail@gmail.com, Sep 17, 2013
Affected Version: 2.7-rc2-505-g7502a46

What steps will reproduce the problem?
1. Resubmit a change (rebased) that was previously reverted (e.g. Create a change A for master; Merge A; Revert A (creates change B); Merge B;)
2. On A (merged, closed), click "Cherry Pick To" and point it to master.  
3. A warning will tell you that the change-id used in the commit message is already used in the master branch and that change (change A) is closed. Try again, this time removing the Change-Id line from the text area in the "Cherry Pick To" dialog.

What is the expected output? What do you see instead?

Similar to the git-review utility, I would expect Gerrit to automatically create a new change-id. Or at the very least throw a warning before the change is created about missing Change-Id.

Instead it just creates the change without a Change-Id. Thus making it (afaik) impossible to amend that change from the command line further as it can't be checked our and submitted back by Change-Id.

Please provide any additional information below.

Example of the above happening: https://gerrit.wikimedia.org/r/#/c/84698/
Sep 17, 2013
#1 krinklemail@gmail.com
For the record, the second time I cherry picked from https://gerrit.wikimedia.org/r/#/c/84473/, I just manually composed a new change-id in place (I moved a few characters around and verified using Gerrit Search that the hash wasn't used yet). 
Sep 18, 2013
Project Member #2 david.pu...@sonymobile.com
Commits created by Gerrit skip some parts of the validation.  The problem here is that the Change-Id is not being added onto the generated cherry-pick commit.

If you compare to the revert feature, the Change-Id is added:

In ChangeUtil.java method "public static Change.Id revert":

      final ObjectId computedChangeId =
          ChangeIdUtil.computeChangeId(parentToCommitToRevert.getTree(),
              commitToRevert, authorIdent, myIdent, message);
      revertCommitBuilder.setMessage(ChangeIdUtil.insertId(message, computedChangeId, true));


> impossible to amend that change from the command line
> 

A missing Change-Id does not prevent you from fetching the change.  You can still fetch it with the refspec, using the download commands on the change screen.

Then if you amend the change on the command line you can push it as a new patch set with:

 $ git push origin HEAD:refs/changes/84698

Sep 18, 2013
Project Member #3 david.pu...@sonymobile.com
(No comment was entered for this change.)
Status: Accepted
Sep 19, 2013
Project Member #4 david.pu...@sonymobile.com
https://gerrit-review.googlesource.com/#/c/49961/
Status: ChangeUnderReview
Sep 30, 2013
Project Member #5 david.pu...@sonymobile.com
(No comment was entered for this change.)
Status: Submitted
Labels: FixedIn-2.8
Dec 9, 2013
Project Member #6 david.pu...@sonymobile.com
(No comment was entered for this change.)
Status: Released
Sign in to add a comment

Powered by Google Project Hosting