Gerrit Change-Id mismatch and push of Multiple Change-Ids commits

445 views
Skip to first unread message

Luciano Carvalho

unread,
Jan 18, 2012, 5:34:11 PM1/18/12
to Repo and Gerrit Discussion
We are observing something in Gerrit that is very unusual. We are using Gerrit version 2.1.8

When changes are pushed with a pre-filled Change-Id, Gerrit usually uses that Change-Id and does not generate a new one.
So, when a new change is pushed, the change-ids in the commit message and Gerrit's change-id match.

Recently, we have observed a lot of changes being created and Gerrit simply ignoring the pre-generated Change-Id line and creating a new one.
The first problem with this is that the id on the commit message does not match Gerrit's.

The commit had one pre-generated Change-Id, but Gerrit has generated a different one. The result of this new change-id hash is the second (and most troubling) issue that we are facing: Gerrit added the new Change-Id to the commit at Submit time (we are using cherry-pick as the submit type). See the example below. (confidential data has been masked)


commit 15f6875f93738111f2bc7fa0f68a711ef7f9e37b
Author: Somebody <some...@motorola.com>
Date: Fri Jan 13 10:26:26 2012 -0800

Commit comments go here... :-)

Change-Id: I42ed9b6c211f447cf68b612f287ba8b36f51e05a
Change-Id: I0cad8ce4d137bf605d1563a67c23d38ebe3941db
Reviewed-on: http://review-server/334505
Tested-by: Autotesttool <auto...@motorola.com>
Reviewed-by: Somebody Else <abc...@motorola.com>
Reviewed-by: Third Person <xyz...@motorola.com>

This is a real commit that has the original Change-Id that was pre-generated by the user, and the second line that was added by Gerrit.

The big problem with this thing is that Gerrit itself won't accept a new push with multiple commit-ids in the commit message (and I remember it used to accept it in previous versions). So, when we want to cherry-pick and propagate that integrated commit to another branch, Gerrit won't let us push it.

I know Gerrit, on version 2.1.8, not accepting the multiple change-ids in the commit message is a known issue (or feature ??? -- sigh), but what we are trying to understand here is why it's not using the pre-generated Change-Id to create a new change, and also why is it generating multiple Change-Id commits itself if it won't accept the same commits later?

I searched Gerrit and there was no existing change that matched the user's Change-Id.

Can someone help me understand what's going on?

Thanks,

Luciano.

Matthias Sohn

unread,
Jan 18, 2012, 6:39:01 PM1/18/12
to Luciano Carvalho, Repo and Gerrit Discussion
2012/1/18 Luciano Carvalho <lsca...@gmail.com>
Is the pre-filled change-id in the last paragraph of the commit message ?
Are any unusual invisible characters in the commit message ?
Is maybe a non-standard text encoding used in the commit message 
(AFAIK JGit/Gerrit use UTF-8) ?
 
--
Matthias

Luciano Carvalho

unread,
Jan 18, 2012, 9:00:23 PM1/18/12
to Matthias Sohn, Repo and Gerrit Discussion

Yes.
No.
Not sure.

Saša Živkov

unread,
Jan 25, 2012, 12:44:47 PM1/25/12
to Luciano Carvalho, Repo and Gerrit Discussion
> are trying to understand here is why it's not using the pre-generated
> Change-Id to create a new change,

I have only seen this symptom when the change-id is not in the last paragraph
of the commit message.
Can you reproduce this issue?
If yes, please post the commit message which reproduces the issue here.

Saša Živkov

Luciano Carvalho

unread,
Feb 1, 2012, 2:06:38 PM2/1/12
to Saša Živkov, Repo and Gerrit Discussion
We have a lot of instances where, even with the Change-Id line being in the last line, the new change is being created with a new Change-Id, then a duplicate Change-Id is being added to the commit comments at the time of the submit (cherry-pick).

The example I sent in the original email is one that had this problem, and had the Change-Id in the last line.

This is the original commit:


commit 42ed9b6c211f447cf68b612f287ba8b36f51e05a
Author: Somebody <some...@motorola.com>
Date: Fri Jan 13 10:26:26 2012 -0800

Commit comments go here... :-)

Change-Id: I42ed9b6c211f447cf68b612f287ba8b36f51e05a


Gerrit did not use the Change-Id from the message (I42ed9b6c) and created a new one (I0cad8ce4)

This is what we got after the submit:

commit 15f6875f93738111f2bc7fa0f68a711ef7f9e37b
Author: Somebody <some...@motorola.com>
Date: Fri Jan 13 10:26:26 2012 -0800

Commit comments go here... :-)

Change-Id: I42ed9b6c211f447cf68b612f287ba8b36f51e05a
Change-Id: I0cad8ce4d137bf605d1563a67c23d38ebe3941db
Reviewed-on: http://review-server/334505
Tested-by: Autotesttool <auto...@motorola.com>
Reviewed-by: Somebody Else <abc...@motorola.com>
Reviewed-by: Third Person <xyz...@motorola.com>


Thanks,

Luciano

Saša Živkov

unread,
Feb 1, 2012, 3:19:42 PM2/1/12
to Luciano Carvalho, Repo and Gerrit Discussion
2012/2/1 Luciano Carvalho <lsca...@gmail.com>:

> We have a lot of instances where, even with the Change-Id line being in the
> last line, the new change is being created with a new Change-Id, then a
> duplicate Change-Id is being added to the commit comments at the time of the
> submit (cherry-pick).
>
> The example I sent in the original email is one that had this problem, and
> had the Change-Id in the last line.

I know, but I asked if you can reliably reproduce the issue using a
particular commit message?
If you can, this would help in identifying the root cause.

Can you also check for leading and/or trailing white space in the
change-id line?
And also in the (empty) line before it.

Saša Živkov

Reply all
Reply to author
Forward
0 new messages