From 148711d2758a1c65b809c2762b29dcf761907b33 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Thu, 3 Feb 2022 15:31:32 +0000 Subject: [PATCH] CONTRIBUTING: Document gerrit quirks Document how to obtain the commit-msg hook and how to push a change for review. Change-Id: If39e98e2fc20be549a08c88839b4d96a8ab7935b Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/78784 Auto-Submit: Ben Clayton Kokoro: Kokoro Reviewed-by: David Neto Commit-Queue: David Neto --- CONTRIBUTING.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index afbb556daa..4d59e356f6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,6 +22,23 @@ use [Dawn's Gerrit](https://dawn-review.googlesource.com/) for this purpose. Submissions should follow the [Tint style guide](docs/style_guide.md). +## Pushing to Gerrit + +Each change requires a `Change-Id` field in the commit message, which is generated by the [Gerrit commit-msg hook](](https://gerrit-review.googlesource.com/Documentation/cmd-hook-commit-msg.html)). \ +In a bash terminal, with the current path set to your tint source tree, this can be obtained by running the following: + +```bash +f=`git rev-parse --git-dir`/hooks/commit-msg ; mkdir -p $(dirname $f) ; curl -Lo $f https://gerrit-review.googlesource.com/tools/hooks/commit-msg ; chmod +x $f +``` + +If you've already locally committed a change without the `Change-Id`, running `git commit --amend` will add the missing `Change-Id`. + +To create a Gerrit change for review, type: + +```bash +git push origin HEAD:refs/for/main +``` + ## Community Guidelines This project follows