Gerrit trick: using Change-Id

86 views
Skip to first unread message

Jean-Baptiste Queru

unread,
May 25, 2012, 1:32:38 PM5/25/12
to android...@googlegroups.com
Gerrit has a mechanism to track which commits are variants of the same
change, so that the review can have a single comment thread across
multiple commits.

It uses a field called "Change-Id" in the footer of the commit
message, and considers that two commits with the same Change-Id in the
same branch and in the same project are related to one another.

The important part is that the Change-Id must be in the *footer* of
the git commit message, i.e. the last paragraph. It intentionally
ignores Change-Id if it's anywhere else in the message. If a change is
uploaded without a recognized Change-Id, Gerrit uses the SHA-1 of the
commit as the Change-Id, for its own tracking.

The Change-Id is displayed in the Gerrit UI at the top-left of each change.

If you upload new versions of any change, please make sure that the
Change-Id matches. It's meant to be easy to copy-paste out of Gerrit.

If you upload a commit that's meant to be an update to any change but
get it wrong, abandon the new change, amend your commit locally to add
the proper Change-Id in the last paragraph (copy-paste it out of the
top-left box in Gerrit), and re-upload.

Thanks,
JBQ

--
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.
Reply all
Reply to author
Forward
0 new messages