Skip to content

gerrit: improve revert commit message template, if possible #30530

Open
@dmitshur

Description

@dmitshur

When using Gerrit UI to create a revert of a CL, it populates the commit message with the following template:

Revert "{{.OriginalTitle}}"

This reverts commit {{.CommitHash}}.

Reason for revert: <INSERT REASONING HERE>

For example:

image

In most contexts of the Go project, we refer to changes by the CL number or a shortlink of the form golang.org/cl/nnn. This has some advantages compared to using the commit hash:

  • shorter and less visual noise
  • CL page contains code review discussion, in addition to the change; commit requires one extra click to get to discussion

If possible, we should consider changing the template to be:

Revert "{{.OriginalTitle}}"

This reverts https://golang.org/cl/{{.OriginalCL}}.

Reason for revert: <INSERT REASONING HERE>

Or perhaps the This reverts CL {{.OriginalCL}}. form.

Revert CLs are generally created in situations that involve more time pressure and stress compared to normal CLs, so it's less reliable for us to depend on people to remember to do this manually, or to reference documentation like at https://golang.org/wiki/CommitMessage. It's better to adjust the template.

Implementation

I'm not very familiar with the configurability of our Gerrit instance and whether this is possible. /cc @andybons @bradfitz From looking at its source at https://gerrit.googlesource.com/gerrit/+/v2.16.6/polygerrit-ui/app/elements/change/gr-confirm-revert-dialog/gr-confirm-revert-dialog.js#50, it may be the case that this is not a configurable Gerrit feature, and so this may be blocked on a feature request for Gerrit.

This issue is to investigate whether this is possible, and whether we agree it's a good idea. /cc @ianlancetaylor

Metadata

Metadata

Assignees

No one assigned

    Labels

    CommunityDevExpanything around developer experienceFeatureRequestIssues asking for a new feature that does not need a proposal.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.help wanted

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions