Problem/Motivation

Split-off from #2802947: [meta] Use the Git commit message format from AngularJS. AngularJS uses multiple lines for git commit messages.

Pros:

  • Git log is easier to read because all the independent parts of a commit messages are split over multiple lines.

Cons:

  • Too much information is hidden in long commit messages, but we should document changes in discoverable change records (index by search engines).
  • Moving commit credit of the contributors to a separate line at the very end devalues their contribution.
  • Having the # issue number on a separate lines makes it harder to find it.

Proposed resolution

?

Remaining tasks

Discuss and list pros and cons.

Comments

klausi created an issue. See original summary.

cilefen’s picture

Moving commit credit of the contributors to a separate line at the very end devalues their contribution.

I do not think it does.

penyaskito’s picture

Moving commit credit of the contributors to a separate line at the very end devalues their contribution.

Having the # issue number on a separate lines makes it harder to find it.

Actually, this could make them easier to parse by external tools or d.o for promoting attribution reports or improving traceability.

cilefen’s picture

pfrenssen’s picture

Very much in favor for having more information in the commit messages. I rely on git log to find code changes much more than searching on drupal.org.

I think the cons in the summary are not really applicable. I would NOT split up the current data over multiple lines, there is absolutely no added value in that. I would KEEP the current format for the first line, so that we have the issue number, the contributors and the issue title on the first line. What I'd like to have in the multiline comment is a short description of WHAT has changed in the commit, and WHY.

The actual con for this is that we have to write a short description for every single issue, that is additional work. Often the issue summary is outdated by the time an issue is committed, so it cannot be directly used for it.

subhojit777’s picture

Too much information is hidden in long commit messages

Where else we are using the extra information. I know, the usernames mentioned in the commit message is used for the credits.

Moving commit credit of the contributors to a separate line at the very end devalues their contribution.

Really? Only the vital information will be the subject of the message, the rest can be written in the body. For example,

[Subject]
Issue #12345: Drupal 8 -> 9

[Body]
Dries

Drupal 9 released. Three Cheers!!

Then we can parse the log and obtain the credit users from 3rd line. Or the tool can identify the first line of commit message body. Whichever approach we choose.

Having the # issue number on a separate lines makes it harder to find it.

Issue number is a vital information, and should be put as the subject of message.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

dww’s picture

At the bare minimum, I'd be in favor of moving the contributors to a separate line after the issue nid and short 1-line summary.

E.g.:

commit d1faffc7256b348628ae667e1180ede541dce3ec
Date:   Mon Apr 17 23:07:14 2023 +0100

    Issue #3340712: Add Single Directory Components as a new experimental module

by e0ipso, alexpott, larowlan, dww, _pratik_, catch, penyaskito, mherchel, pdureau, jonathanshaw, mglaman, idiaz.roncero, geek-merlin, ctrlADel, mrweiner, bnjmnm, longwave, guschilds, cosmicdreams, dreamleaf, ckrina, Gábor Hojtsy, lauriii, unstatu, markconroy, nod_

We could potentially put each contributor on its own line, perhaps with additional stuff like organizations.

Maybe even a role they're being credited for (author, reviewer, tester, etc), although that could start to get cumbersome, and in some cases, it's a pretty blurry distinction. E.g. if someone comes in with a very detailed review, suggests new code blocks, etc, are they just a reviewer or are they also sort of an author now?

But to start, the main thing is making the git log scannable so you can actually see what a commit changed, not a wall of usernames before you can even find out what the commit was for. All sorts of Git tooling expects a 1-line summary for each commit.

Thanks,
-Derek

penyaskito’s picture

If we change this, I'd like to have one contributor per line, and we can use "tagging", but as @dww mentioned that could be hard.

Github and Gitlab already supports this:

Approved-by: Jane Doe
Reviewed-by: John Doe
Co-Authored-by: James Doe

And for crediting also organizations if needed, https://gitlab.com/gitlab-org/gitlab/-/issues/327138 is relevant.

dww’s picture

Status: Active » Needs review

x-posting from #2323715-84: [policy, no patch] Determine format for commit credit for individuals/organizations/customers for more visibility:

My only suggestion to the template in the summary is that instead of using "Issue" all the time, why not add value to those bytes and use the 1-word version of the category? Like so:

Bug #3029061: New layouts are missing config schema
...
Task #3027938: Abstract the contents of LayoutBuilderController into a render element
...
Feature #3015886: Add an in-memory config storage
...
kim.pepper’s picture

#22 I think that adds a lot of value.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Needs review » Reviewed & tested by the community

Everyone who has commented on this issue supports using multiple lines in the git commit message.

The details of that format are currently being discussed in #2323715: [policy, no patch] Determine format for commit credit for individuals/organizations/customers

catch’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.