Feature request: have the ability to configure Gerrit to send email similar to 'git send-email'

71 views
Skip to first unread message

Kenny Ho

unread,
Apr 28, 2026, 12:00:00 PMApr 28
to Repo and Gerrit Discussion
I understand that Gerrit has a lot of email features already (Email Template, email ingest, etc. https://gerrit-review.googlesource.com/Documentation/config-mail.html) but it seems to be a few features away from being able to send email the way 'git send-email' does it (to encourage integration/coming-together with mailing-list-based review):

1) having a concept of patch series in mail templates (Gerrit already have the 'series' concept in the form of Relation Chain) such that template can have a variable for the commit index and commits count in the series (to produce patch [3/10] in a particular email, for example.)
2) patchset ID of the first commit in a Relation Chain can be used as the series version (like v5 in the example below)
3) being able to send 'cover letter' in 'git send-email' sense (summerizing all the commit subjects and file delta.)  I think this can be done as a 'Send' option in the Reply interface?  (perhaps something like "Send as series'?)

Example of send-email format:
https://lkml.org/lkml/2026/1/22/1701

What do you think?

Oswald Buddenhagen

unread,
Apr 29, 2026, 6:15:24 AMApr 29
to repo-d...@googlegroups.com
On Tue, Apr 28, 2026 at 09:00:00AM -0700, Kenny Ho wrote:
>What do you think?
>
that you should start with a problem statement and elaborate on how the
proposed feature would fit into a workflow that addresses the issue ...

i'll plug some shameless self-promotion here:
https://wiki.qt.io/Git-gpush-scripts

this script manages stacked local series, which it can submit to gerrit
or send-email. probably not your use case?

looking at your request more directly, i observe two things:
- the notification mails gerritreview's server sends used to contain
diffs. this stopped some time ago (at least in the plain-text mails i
have configured), which is a pity. also, last time i checked (which
was quite a while ago) this wasn't a gerrit upstream feature.
if community engagement is the only objective, then this would go a
long way.
- to send threaded mails and cover letters, gerrit would need to learn
about "series" in the first place. so far, it supports only topics,
which is basically just a special hashtag to aggregate changes (which
may or may not be related via their commit ancestry).
such a thing was discussed multiple times, and the qt project even had
it implemented (at prototype quality). see
https://issues.gerritcodereview.com/issues/40000138

Kenny Ho

unread,
Apr 29, 2026, 2:41:38 PMApr 29
to Oswald Buddenhagen, repo-d...@googlegroups.com
On Wed, Apr 29, 2026 at 6:15 AM 'Oswald Buddenhagen' via Repo and
Gerrit Discussion <repo-d...@googlegroups.com> wrote:
> this script manages stacked local series, which it can submit to gerrit
> or send-email. probably not your use case?
Right. I am hoping to use Gerrit as a gate/check before developers
send out their patches to the mailing list (primary use case is to
prevent sensitive keywords from leaking but it can also be used to
reduce noise on the mailing list by forcing pre-run of lint and other
CI functions.)

> looking at your request more directly, i observe two things:
> - the notification mails gerritreview's server sends used to contain
> diffs. this stopped some time ago (at least in the plain-text mails i
> have configured), which is a pity. also, last time i checked (which
> was quite a while ago) this wasn't a gerrit upstream feature.
> if community engagement is the only objective, then this would go a
> long way.
Diff can still be included by changing Gerrit config. I have
confirmed being able to do this.

> - to send threaded mails and cover letters, gerrit would need to learn
> about "series" in the first place. so far, it supports only topics,
> which is basically just a special hashtag to aggregate changes (which
> may or may not be related via their commit ancestry).
> such a thing was discussed multiple times, and the qt project even had
> it implemented (at prototype quality). see
> https://issues.gerritcodereview.com/issues/40000138
Gerrit now has the concept of Relation Chain so this issue is above is
not longer relevant
https://gerrit-review.googlesource.com/Documentation/concept-changes.html#related-changes

Oswald Buddenhagen

unread,
Apr 30, 2026, 3:36:31 AMApr 30
to repo-d...@googlegroups.com
On Wed, Apr 29, 2026 at 02:40:06PM -0400, Kenny Ho wrote:
>I am hoping to use Gerrit as a gate/check before developers
>send out their patches to the mailing list
>
so basically you want gerrit's merge/submit/integrate button to
git-send-email instead of pushing to the target repo.

so how about you make the gerrit repo a scratchpad? when changes are
merged, a hook send-emails the new commits. when the commits are
ultimately merged to the real repo, it is mirrored to the gerrit repo.

>Diff can still be included by changing Gerrit config. I have
>confirmed being able to do this.
>
excellent!

>> so far, it supports only topics,
>> which is basically just a special hashtag to aggregate changes (which
>> may or may not be related via their commit ancestry).
>Gerrit now has the concept of Relation Chain so this issue is above is
>not longer relevant
>https://gerrit-review.googlesource.com/Documentation/concept-changes.html#related-changes
>
nothing i see here contradicts what i said.

it kind of works; my script suite (the git-gpick part in particular)
does actually rely on the relation chain to "divine" series, and it uses
the topics to tell apart series that have a physical dependency, but are
logically still separate.

however, there is still no actual entity that represents a series, and
therefore no good place to attach a cover letter to, or post comments on
the whole series. one could hack it by relying on a convention, for
example that the first commit includes the cover letter in the commit
message below a triple-dash line. this would require some advanced
manipulation in the mail hook, and gerrit's presentation of the info
would be way suboptimal.

Daniele Sassoli

unread,
Apr 30, 2026, 3:49:29 AMApr 30
to Repo and Gerrit Discussion

I've often found myself wanting to provide a cover letter for the whole relation
chain, it would be cool if Gerrit had such mechanism. My main question though is
what would this look like? From a user perspective, how would you want to send
this cover letter to the patch (assuming we're not hacking into a commit message
as mentioned above).

The main issue is that we don't have identifiers for relation chain, so how
would you even assign a cover letter to the chain itself. Maybe that would be
the first step, assigning an identifier to the chain.

Secondly, how would you "push" this cover letter? would it live in your repo's
tree structure or would you only want it in Gerrit? Should the cover letter also
be reviewable?

It's an interesting feature and one that would be nice to get some thoughts on.
Reply all
Reply to author
Forward
0 new messages