[openstack-dev] missing information about change-id in GerritWorkflow wiki?

James E. Blair jeblair at openstack.org
Wed Aug 7 16:31:40 UTC 2013

Roman Gorodeckij <holms at holms.lt> writes:

> Hi,
> I just completely messed up in here. 
> Was reading a manual about Gerrit workflow: https://wiki.openstack.org/wiki/Gerrit_Workflow#Committing_Changes
> And then there's link to here about how to build commit messages: https://wiki.openstack.org/wiki/GitCommitMessages
> and I'm starting to see "Change-id" line in every commit message, which naturally makes me wonder, what is this at all..?

I'm sorry about that.  The Gerrit Workflow page was written as a quick
start guide.  I think it works best as a simple series of steps that if
followed exactly will help you submit a change successfully.  But a lot
has been added to it over the past few years, and it's started to get

There is a much more detailed page at
<URL:https://wiki.openstack.org/wiki/GerritJenkinsGithub> that goes into
exactly how everything operates, including details about the Change-Id
header.  Unfortunately, that link was buried below a large diagram; I've
moved it back to the first paragraph to make it more visible.

I suspect both of these pages need to be refreshed, particularly to
simplify "Gerrit Workflow" and make the other reference documentation
easier to refer to from the simple page.

> There's explanation in manual 
> The 'Change-id' line is a unique hash describing the change, which is generated by a GIT commit hook. This should not be changed when rebasing a commit following review feedback, since it is used by Gerrit, to track versions of a patch.
> and my first reaction is … 'wat?'. What is git commit hook? Where's instruction how to install it. If manual should explain workflow, I'd like to have full of it, not just "figure out your self"
> Of course in IRC #openstack-dev this was explained:
> 08:26 < agorodnev> holms: usually I push to gerrit and it tells me that I forgot to add change id and
>                    suggests me change id =) I copy it, do git commit --amend, append change id to commit
>                    message. That works =)
> 08:28 < agorodnev> holms: you need to put commit-msg file to .git/hooks
> 08:31 < agorodnev> $>scp -p -P 29418 <your-login>@review.openstack.org:hooks/commit-msg .git/hooks/
> 1) I'm considering this practise not normal at all, just a workaround
> 2) Would be nice to have this in manual, because I just don't know what to do next if I'm on my own learning curve. 

No one should ever have to do that!

As mentioned in another reply, just run "git review -s" and it will
install it for you.  Moreover, the first time you run "git review",
git-review itself will install the hook and amend your commit if needed
to add the Change-Id header.  The process should never be more
complicated than this:

  git clone ...openstack/foo
  git checkout -b my-change
  git commit -a
  git review

Anything more complicated than that is a bug and we'll be happy to fix


More information about the OpenStack-dev mailing list