How do folks manage Gerrit relation chains in Chromium?

75 views
Skip to first unread message

hewro

unread,
Feb 9, 2026, 9:48:03 AM (3 days ago) Feb 9
to Chromium-dev
Hi,
   I’m trying to understand the common workflow for Gerrit relation chains in Chromium, and I’d love to hear what others do.
   Do people typically:
   1) Install the Gerrit `commit-msg` hook (`.git/hooks/commit-msg`) so each commit gets its own `Change-Id`, then stack commits (commit lineage determines the dependency chain),
 https://gerrit-review.googlesource.com/Documentation/user-changeid.html
2) Use a “one CL per branch” workflow, and rely on branch setup (e.g. `git branch --set-upstream-to=<upstream_branch>`) to manage the association between CLs?
If I’m misunderstanding how Gerrit establishes these relationships, please correct me. Thanks!

Mike Frysinger

unread,
Feb 9, 2026, 10:43:05 AM (3 days ago) Feb 9
to ihe...@gmail.com, Chromium-dev
develop in git like you would normally develop in git.  push that history to Gerrit for review.  Gerrit handles git relationships just fine.

if changes are related, keep them in one (local) branch.
if changes aren't related, use separate (local) branches.
-mike

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/2c903a54-8666-4708-8b20-1a6e2d158f61n%40chromium.org.

David Roger

unread,
Feb 9, 2026, 10:55:57 AM (3 days ago) Feb 9
to vap...@chromium.org, ihe...@gmail.com, Chromium-dev
I do option 2. I have never heard about option 1.

Mike Frysinger

unread,
Feb 9, 2026, 11:01:08 AM (3 days ago) Feb 9
to David Roger, ihe...@gmail.com, Chromium-dev
you don't need to do option 1.  when you use gclient to obtain chromium checkouts, it installs the commit hook for you automatically.
-mike

Will Harris

unread,
Feb 9, 2026, 11:20:48 AM (3 days ago) Feb 9
to Chromium-dev, ihe...@gmail.com, David Roger, vap...@chromium.org
I use https://www.chromium.org/developers/how-tos/get-the-code/working-with-branches/#suggested-branching-workflow which I think is 2.

In particular, the "git branch --set-upstream-to=branch1" syntax is the command I always forget and always have to cut and paste it from that website.

Will

hewro

unread,
Feb 9, 2026, 11:59:16 AM (3 days ago) Feb 9
to Chromium-dev, Will Harris, David Roger, vap...@chromium.org, ihe...@gmail.com
Thanks for the replies!
 
One clarification on my side: I got my checkout via `gclient sync` (and ran hooks), but `.git/hooks/commit-msg` did not get installed automatically for me. As a result, `git commit` currently does *not* append a `Change-Id` to my local commit messages, which made me assume option (1) isn’t the default workflow (at least in my environment).

That said, I’ve seen some discussions suggesting you can still have a relation chain without switching branches (e.g. https://groups.google.com/g/repo-discuss/c/qiECIsLGdCI). Combined with Gerrit’s `commit-msg` hook docs, maybe some Chromium subprojects  rely more on that “stack commits on one branch” model. 

Also, thanks Will for the branching doc — that page is very clear and matches what I should be doing!

David Baron

unread,
Feb 9, 2026, 1:12:47 PM (3 days ago) Feb 9
to ihe...@gmail.com, Chromium-dev
I used to use option (2).  At some point I switched to option (1).  I think it's a bit simpler, but I also haven't done all that much development of relation chains since I switched, so I haven't stress-tested it as much.  (And I did have to install the commit hook.)

I think one of the painful parts of using option (2) was what happened when submitting the earlier part of a relation chain while continuing to develop the later part.  This sometimes led to difficulty merging.  I think this is somewhat better with workflow (1) but I'm also not entirely sure.

-David

--

Nick Harper

unread,
Feb 9, 2026, 2:18:13 PM (3 days ago) Feb 9
to dba...@chromium.org, ihe...@gmail.com, Chromium-dev
I do workflow 1 (used to do 2), as it matches the way I like to work with git better. Do whichever works better for you.

I find option 1 easier to upload a batch of cls at once, but I still haven't figured out how to get them to land together easily. Once they're in gerrit (with the appropriate relation chain) it doesn't matter which workflow you use locally.

Mike Dougherty

unread,
Feb 10, 2026, 2:30:44 AM (2 days ago) Feb 10
to nha...@chromium.org, dba...@chromium.org, ihe...@gmail.com, Chromium-dev
I use workflow #2 as well and created some aliases to generally make the "git-cl" commands easier for workflows like creating depended branches.


Justin Novosad

unread,
Feb 10, 2026, 11:33:16 AM (2 days ago) Feb 10
to w...@chromium.org, Chromium-dev, ihe...@gmail.com, David Roger, vap...@chromium.org
On Mon, Feb 9, 2026 at 11:17 AM Will Harris <w...@chromium.org> wrote:
I use https://www.chromium.org/developers/how-tos/get-the-code/working-with-branches/#suggested-branching-workflow which I think is 2.

In particular, the "git branch --set-upstream-to=branch1" syntax is the command I always forget and always have to cut and paste it from that website.

I use the shorthand "-u" flag which is easier to remember.
 
Reply all
Reply to author
Forward
0 new messages