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. This preserves the history of patch comments, and allows comparing old and new versions of a patch for more efficient inspections. For this to work properly the changes you create locally need to have a unique commit id in them. To get the Commit-Id: field inserted automatically, copy the commit-msg hook from the build/ subdirectory into each Git repository's .git/hooks/ directory. This will update the commit message for changes you commit to your repository before they are submitted to Gerrit. The commit-msg hook will also verify that the commit message format matches the format specified above. Similarly, copying the prepare-commit-msg script from build/ to .git/hooks/ will run the build/checkpatch.pl script against each patch at commit time to check it against the Lustre Coding Guidelines.

For older Lustre versions that are missing the commit hooks, they can be copied from a newer branch of Lustre (e.g. master), and the .git/hooks/ directory is shared among all branches (it is not updated when checking out a new branch).

...

Switch to the branch you want to create a branch in (normally master or b1_8).

Create the tag with:

Code Block
git tag -a TAG_NAME

...

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 A critical thing to point out is that you need update submit a new version of the full entire 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, do that now) you can copy it from the change in Gerrit top Gerrit web page for that change 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.

...