Zulip Chat Archive

Stream: PR reviews

Topic: mathlib4 PR titles


Apurva Nakade (Jul 23 2023 at 02:47):

Is there a preferred style for mathlib4 PR titles? I'm looking at the commit history for mathlib4 and the commits use all kinds of conventions.

Apurva Nakade (Jul 23 2023 at 02:47):

Are we not reverting back to mathlib conventions?

Scott Morrison (Jul 23 2023 at 03:40):

I think the rule has changed to match Lean 4, so the file name isn't specified in the commit title. That is, it should be one of feat, chore, fix, doc (maybe some others?), following by a colon, followed by a very short description, and then hopefully more explanation in the PR description. (Which becomes part of the commit message when we squash merge.)

Scott Morrison (Jul 23 2023 at 03:40):

But we should actually decide, and document whatever the decision is!

Jireh Loreaux (Jul 23 2023 at 04:02):

Also perf

Yury G. Kudryashov (Jul 23 2023 at 04:11):

Are refactors chore, feat, or something else?

Jireh Loreaux (Jul 23 2023 at 04:13):

I would say it depends on the refactor.

Eric Wieser (Jul 23 2023 at 08:54):

Scott Morrison said:

But we should actually decide, and document whatever the decision is!

IMO the mathlib3 convention (feat(some/path): some summary) was better: It's a lot easier for me to tell whether I'm a suitable reviewer for a file if I can see an estimate of the files changed from the PR list. I don't think consistency with the Lean4 core repo is particularly important.

Damiano Testa (Jul 23 2023 at 09:04):

I'm also in favour of having the changed files.

Having the list readily available in the description helps to debug breaking changes, when you merge master and want to figure out what is causing issues.

Eric Wieser (Jul 23 2023 at 09:05):

/poll which convention should we use in mathlib4

  • type(partial/path): summary, like we did in mathlib3
  • type: longer summary, like the core lean4 repo does

Eric Rodriguez (Jul 23 2023 at 09:42):

I feel like often changed files leads to unwieldy titles. I get that homogeneity is valuable, but I think being able to make the choice is also good

Eric Rodriguez (Jul 23 2023 at 09:42):

I often typed feat(*) or chore(*) in mathlib3 for stuff that toiched many files in different ways

Eric Wieser (Jul 23 2023 at 09:54):

I think having type(*): summary for PRs that touch too many things is fine

Mario Carneiro (Jul 23 2023 at 15:22):

We could just make it optional? I think the file name was useless or misleading a not insignificant fraction of the time, and it's quite noisy, often using up all of the ~50 characters reserved for git commit headers

Eric Wieser (Jul 23 2023 at 15:23):

Do we care about the 50 character limit?

Eric Wieser (Jul 23 2023 at 15:23):

Most of our review happens on github where that limit is irrelevant

Mario Carneiro (Jul 23 2023 at 15:23):

I mean, it's a UX issue

Mario Carneiro (Jul 23 2023 at 15:23):

people see commits in a variety of ways, not just on github

Mario Carneiro (Jul 23 2023 at 15:24):

the point is so that you can easily summarize the commit in short log-like formats

Mario Carneiro (Jul 23 2023 at 15:25):

and github will also automatically spill some of the first line into the PR description sometimes

Eric Wieser (Jul 23 2023 at 15:25):

That behavior is certainly annoying, but can be overriden manually

Mario Carneiro (Jul 23 2023 at 15:26):

yeah but you don't always catch it, I'm sure there are plenty of those in the history

Eric Wieser (Jul 23 2023 at 15:27):

The behaviour is only relevant if your branch has only one commit on it though

Eric Wieser (Jul 23 2023 at 15:27):

Otherwise you get some stupid yourusername de slugged branch name PR title anyway

Mario Carneiro (Jul 23 2023 at 15:29):

sure, but that's the majority of my PRs, since I don't use commits for development until after putting the PR up

Eric Wieser (Jul 23 2023 at 15:31):

According to the link above some other web search I made the problem goes away if you make the PR via the github command line rather than the web interface

Mario Carneiro (Jul 23 2023 at 15:36):

also Mathlib/ are 8 characters I don't want to see in a PR title

Mario Carneiro (Jul 23 2023 at 15:39):

the whole thing looks like just so much busy work and hides the actual description. I am very happy the lean 4 convention is so much lighter and don't think we should go back. If you want to include a file name nothing is stopping you

Eric Wieser (Jul 23 2023 at 15:47):

I completely agree if we go back to the old convention it should be feat(Data/Nat/Basic): summary not feat(Mathlib/Data/Nat/Basic): summary; just like how we dropped src before

Eric Rodriguez (Jul 23 2023 at 21:08):

I'd prefer Nat/Basic there for example though

Eric Rodriguez (Jul 23 2023 at 21:09):

The Data/ takes a lot of space already

Jireh Loreaux (Jul 23 2023 at 21:34):

I think if people want to add this info it should be the first line of the body, but not included in the subject line.

Eric Wieser (Jul 23 2023 at 21:47):

The problem with not including this info in the title is that it's not there to help attract reviewers when looking at the PR list

Eric Wieser (Jul 23 2023 at 21:48):

I guess to some extent the t-topic labels can serve that role, but they're inevitably much coarser

Eric Wieser (Jul 23 2023 at 21:50):

My claim would be that >90% that people are actually reading the first line of a mathlib commit message, it is because they are looking (or searching) through the PR list

Jireh Loreaux (Jul 23 2023 at 21:55):

Yes, I would say that is what t-topic is for. The queue filtered by these is generally small enough for review.

Scott Morrison (Jul 23 2023 at 23:37):

How about a compromise:

  • type: summary by default, unless the best way to summarise the change is by specifying the file which the PR modifies, in which case type(partial/path): missing @[simps] or type(partial/path): lemmas for X, etc is preferred?

Along with strong encouragement to use t-topic, along with a linkifier for #queue items without a t-topic for assistance managing this?


Last updated: Dec 20 2023 at 11:08 UTC