Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Gerrit will automatically identify updates to existing patches and update the existing request instead of creating a new one. For this to work properly the changes you create locally need to have a unique commit id in them. To get this inserted automatically, add copy the commit-msg hook provided by Gerrit to your Git repository's .git/hooks/ directory. This will update the commit message for changes you commit your changes to your repository. Here are two ways to get the hookNewer versions of Lustre include the commit-msg and prepare-commit-msg hooks in the build/ subdirectory, or it can be downloaded from this page using curl or wget:

No Format
$ scpcurl -p -P 29418 reviewo .git/hooks/commit-msg http://wiki.whamcloud.com:hooks/download/attachments/7111125/commit-msg .git/hooks/

$ curl -o .git/hooks/commit-msg http://reviewwiki.whamcloud.com/toolsdownload/attachments/hooks/commit-msg

...

7111125/prepare-commit-msg

...


Note that you might have to add the required execute permissions to the hook hooks once you have fetched itthem:

No Format
$ chmod 755a+x .git/hooks/*commit-msg

Creating Inspection Requests

...

Gerrit makes it easy to update an inspection request with a new patch, and doing this allows inspectors to see differences between the patches so they only need to inspect the changes. Also, the original inline comments are maintained and moved to the new patches. The key to keeping updated inspection requests linked to the original patch is the Change-Id: field - this is what Gerrit uses to find the original patch to update.

And critical thing to point out is you need update a new version of the full change - not just an update to the change. The usual way of doing this is to apply the updates to your tree as usual and create a new commit (this time the commit message doesn't matter as you are about to change it). Then, merge the two changes using "git rebase -i <parent-branch>". Interactive rebase will display a list of patches in an editor, and you can "squash" the the modifications to the patch in the new commit into the original patch. (See the help text in the commit message editor window for more information.) Then it will put you in an editor again to manually merge the two commit messages. Make sure you keep the original Change-Id: line, and delete the new one, and edit the commit messages so they're combined into a single commit. If you don't have a Change-Id: line in your commit message (because you didn't install the commit-msg hook above) you can copy it from the change in Gerrit and paste it into the new commit message. Once the change is committed, push your branch to Gerrit again, and the original request will be updated with the new version of the patch.

...