Page MenuHomePhabricator

Create a git commit message template for GrowthExperiments
Open, Needs TriagePublic

Description

Partly inspired from thinking about T297880: Improve documentation for GrowthExperiments, I think it could be helpful to have a git commit message template for GrowthExperiments. Here's an example git commit template https://gist.github.com/lisawolderiksen/a7b99d94c92c6671181611be1641c733

Looking at that user's template, we could perhaps modify it to have prompts to encourage updating documentation, and writing tests.

# Title: Summary, imperative, start upper case, don't end with a period
# No more than 50 chars. #### 50 chars is here: #

# Remember blank line between title and body.

# Body: Explain *what* and *why* (not *how*)
# Wrap at 72 chars. ################################## which is here: #

# Does your patch require updating documentation in ./docs? If so please update 
# the docs!
# Does your patch have tests?
# Bug: {Phab}
# At the end: Include Co-authored-by for all contributors. 
# Include at least one empty line before it. Format: 
# Co-authored-by: name <user@users.noreply.github.com>
#
# How to Write a Git Commit Message:
# https://chris.beams.io/posts/git-commit/
#
# 1.Separate subject from body with a blank line
# 2. Limit the subject line to 50 characters
# 3. Capitalize the subject line
# 4. Do not end the subject line with a period
# 5. Use the imperative mood in the subject line
# 6. Wrap the body at 72 characters
# 7. Use the body to explain what and why vs. how

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
kostajh added subscribers: Sgs, DMburugu, mewoph, Tgr.

Discussion item for the engineers; moving to Triaged. cc @mewoph, @Sgs, @Tgr, @DMburugu

IMO git commit message templates generally fall into the "if you know about it, you don't need it" category.

I have a commit message template in my personal dotfiles that is currently the following:

.gitmessage
 
 
# Why is it necessary?

# Describe, at a high level, what was done to affect change

# What side effects does this change have?

# What (subtle) technical decisions were made in this code and why, with what tradeoffs?

# Bug:

Still, most of my commit messages are often just the summary and Bug: T...... line. But I still think it helps having these prompts there as a reminder when one needs to write more.

Though the lines about docs and tests might be nice to adopt, even just to make it a tiny bit harder to submit a change that doesn't. 🤔

My 2c would be to use the one that ships with core https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/refs/heads/master/.gitmessage; I typically run git config commit.template ~/path/to/mediawiki-core/.gitmessage in new extensions that I clone