[policy, no patch] Determine format for commit credit for individuals/organizations/customers

Created on 19 August 2014, about 10 years ago
Updated 8 April 2024, 7 months ago

Problem/Motivation

#2288727: [meta] Provide credit to organizations / customers who contribute to Drupal issues aims to provide commit credit to organizations.

This issue is postponed (per #56) on having a few months of comment attribution data to play with.

Proposed resolution

Change the commit message template to a multiline format, similar to the format used by several other open source projects (Linux, OpenStack, Eclipse, Typo3). Put credit information in the "footer" of the commit message, like:

Supported-by: Drupal Association drupal-association@1646370.org.no-reply.drupal.org

This is a representation of [Organization Node Title] [Organization Alias]@[Organization Node ID].org.no-reply.drupal.org, and allows tying the credit back to organization nodes.

An example of a full generated commit message might be for an issue such as #2183983: Find hidden configuration schema issues :

git commit -m 'Issue #2183983: Find hidden configuration schema issues

Contributed-by: Gábor Hojsty <goba@4166.no-reply.drupal.org>
Contributed-by: Vijayachandran Mani <vijaycs85@93488.no-reply.drupal.org>
Contributed-by: Wim Leers <wimleers@99777.no-reply.drupal.org>
Contributed-by: Sascha Grossenbacher <berdir@214652.no-reply.drupal.org>
Contributed-by: Florian Weber <webflo@254778.no-reply.drupal.org>
Contributed-by: Alex Pott <alexpott@157725.no-reply.drupal.org>

Supported-by: Acquia <acquia@1204416.org.no-reply.drupal.org>
Supported-by: Capgemini <capgemini@1772260.org.no-reply.drupal.org>
Supported-by: MD Systems <md-systems@1979456.org.no-reply.drupal.org>
Supported-by: UEBERBIT GmbH <ueberbit@1838438.org.no-reply.drupal.org>
Supported-by: Chapter Three <chapter-three@1121246.org.no-reply.drupal.org>

Supported-by: Some Mysterious Drupal 8 Client <mysterious-d8-client@XXXX.org.no-reply.drupal.org>
Supported-by: Some Other Mysterious Drupal 8 Client <mysterious-d8-client2@XXXX.org.no-reply.drupal.org>
'

We can use historical Git commit mentions to populate historical commit entities to give credit to individual contributors for past contributions. This should keep history in sync going forward. Because of the way that the supported-by element works, we can only track organization commit mentions going forward from the release of this feature.

Other solutions that have been discussed and put aside include using Git notes (while it's the right tool for the job, there is not rich enough support in various clients, and it requires engineering effort on Drupal.org infra side as well), and using special characters to denote individuals vs. employers vs. customers (this is a non-standard "Drupalism," it creates weirdly formatted commit messages that can't ever be changed).

Remaining tasks

Discuss, agree on exact format for implementation.

User interface changes

Auto-generated commit message template in the "Credit & Committing" UI will change; https://www.drupal.org/node/52287 will need to be updated.

API changes

Unknown. In #48 joshuami notes: "All credit will be associated with a commit rather than the issue. We will need to confirm that the commit entity (version control operation) that we store on Drupal.org can have fields, or other storage can be implemented cleanly. We can parse the users and organizations from the commit message, and associate them with the commit entity as user and node entity references."

Original report by @webchick

#2288727: [meta] Provide credit to organizations / customers who contribute to Drupal issues aims to provide commit credit to organizations. There are a few ways this can be done:

Embed credit in commit message itself

This is the format proposed at http://buytaert.net/a-method-for-giving-credit-to-organizations-that-con... (slightly tweaked to put the credit at the end in order to keep commit messages sensible, discussed and agreed upon at #2288727-31: [meta] Provide credit to organizations / customers who contribute to Drupal issues and following:

$ git commit -am "Issue #n: message by INDIVIDUAL@AGENCY*CUSTOMER."

For example (this would be auto-generated so just a copy/paste):

$ git commit -m "Issue #42: fixed performance bug by Sam@Acquia, Megan, Tim*Pfizer."

Pros

  • No special tooling required; could start using this format immediately.
  • Credit is immediately obvious, in a very developer-facing place.
  • Credit also visible in third-party tools; GitHub, cgit, Git GUIs such as Tower, etc..... basically every single thing that works with Git knows how to display commit messages.

Cons

  • On issues with multiple authors (especially complex core issues) you could easily end up with a 2048+ character commit string.
  • A "Drupalism"; no other project does it this way.

Embed credit in Git notes

git notes is a way to add metadata to commits without actually affecting the commits themselves. See https://groups.drupal.org/node/161659 for some prior art on this discussion.

For example (this would be auto-generated so just a copy/paste):

git commit -m “Issue #2125621: Fixed Contrast between title/slogan and header is too low.”  --author=“David Hernandez <foo@bar.com>” --git-notes=“davidhernandez*New Jersey Something Something
mgifford@Open Concept
jessebeach@Acquia
mparker17@Open Concept*Government of Canada*Whitehouse
anandps
”

Pros

  • Git notes is specifically for storing additional metadata, so we're using Git as Linus (or whoever) intended. :P
  • Commit messages can go back to just "Issue #1234: Fixed the thing." which is standard with nearly all other projects.
  • Can even go back to old commits and add this information. Doesn't change the commit hash!
  • Because this information is not intended to be human-readable per se, can embed much more detailed information, for example actual user / organization IDs, which can ease parse-ability/improve accuracy (however, this seems to be a no-op because according to drumm in #19, the UI being developed at #2295411: Auto-generate Git attribution info / commit messages on Drupal.org will populate tables).

Cons

  • Credit not immediately visible without some special tricks, e.g. git show -s or custom Drupal.org listings.
  • May require significant tooling to get custom listings working on Drupal.org; #1282040: Add support for reading git-notes sounds a bit spooky (though could tie it to the issue rather than the Git commit to work around VCAPI).
  • Not a widely used feature, so unknown level of support in third-party tools (Git GUIs, source code browsers, etc.) for displaying Git notes. As a prominent example, GitHub used to have and then recently removed support for displaying git notes.
  • Also a "Drupalism"; no other project does it this way.

Embed credit in commit message itself (another way)

Adding a block of text describing attribution in the commit message as the linux kernel or git itself project does it.
Notice we will be extending what those projects do adding a new keyword, "Supported-by".

Detailed:

	Signed-off-by: Coder1 Name <coder1@git.mail>
	Signed-off-by: Coder2 Name <coder2@git.mail>
	Reported-by: Reporter1 Name <reporter1@git.mail>
	Tested-by: Tester1 Name <tester1@git.mail>
	Reviewed-by: Reviewer1 Name <individual2@git.mail>
	Suggested-by: Suggester1 Name <suggester1@git.mail>
	Supported-by: Agency1 Name <agency@agency-domain.com>
	Supported-by: Customer1 Name <customer@customer-domain.com>

Not detailed:

	Signed-off-by: Coder1 Name <coder1@git.mail>
	Signed-off-by: Coder2 Name <coder2@git.mail>
	Signed-off-by: Reporter1 Name <reporter1@git.mail>
	Signed-off-by: Tester1 Name <tester1@git.mail>
	Signed-off-by: Reviewer1 Name <individual2@git.mail>
	Signed-off-by: Suggester1 Name <suggester1@git.mail>
	Supported-by: Agency1 Name <agency@agency-domain.com>
	Supported-by: Customer1 Name <customer@customer-domain.com>

Pros

  • No special tooling required; could start using this format immediately.
  • Credit is immediately obvious, in a very developer-facing place.
  • Credit also visible in third-party tools; GitHub, cgit, Git GUIs such as Tower, etc..... basically every single thing that works with Git knows how to display commit messages.
  • Not a "Drupalism"!

Cons

  • On issues with multiple authors (especially complex core issues) you could easily end up with a 2048+ character commit string.
🌱 Plan
Status

Closed: outdated

Version

11.0 🔥

Component
Documentation 

Last updated about 2 hours ago

No maintainer
Created by

🇨🇦Canada webchick Vancouver 🇨🇦

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States dww

    See also 🌱 Discuss if git commit messages should be multiple lines Needs review . Do we need to refactor all of this into a unified meta? There's a ton of overlap between these two issues.

    Bumping to NR.

    Thanks!
    -Derek

  • 🇬🇧United Kingdom catch

    I think we need one issue, not sure which one, maybe a new one altogether with references to the duplicates. The issue credit system is implemented on Drupal.org and doesn't rely on parsing commit messages so most of the discussion here is very out of date now.

    Somewhere... not sure if it's in the issue queue, there's a proposal to rely on https://www.conventionalcommits.org/en/v1.0.0/ which seems worth exploring.

  • 🇦🇹Austria klausi 🇦🇹 Vienna

    Yes please, https://www.conventionalcommits.org/en/v1.0.0/#summary is exactly the Angular git commit format I proposed 7 years ago in #2802947: [meta] Use the Git commit message format from AngularJS . Happy to see they made a specification out of it!

  • 🇺🇸United States drumm NY, US

    It's very likely that we will not keep a version of the commit/merge UI we have on Drupal.org issues when upgrading Drupal.org. The recommended way to do a merge will be using the merge button in GitLab. That almost certainly won’t support a list of usernames like we have now. Git trailers, like mentioned in conventional commits, are likely to have some support. I suspect we may have to do something special to get people who helped the issue, but didn't participate in the MR, mentioned. Ideally, we find a way to forward Drupal.org credit data into GitLab's default merge request commit message.

  • 🇺🇸United States drumm NY, US

    https://docs.gitlab.com/ee/user/project/merge_requests/commit_templates.... has a few options, with varying degrees of hackiness:

    When the maintainer saves issue credit:

    • We could make a MR comment authored by each credited person who hasn't made an MR comment, to update %{reviewed_by}
    • We could make an empty commit authored by each credited person who hasn't made a commit, to update %{co_authored_by}
    • We could reset approvals and say every credited person approved, to update %{approved_by}
    • We could rewrite a commit message on the branch being merged
    • We could update the MR description to update %{description}

    Those are all somewhat non-ideal in various ways. I'd probably choose updating the MR description over the others; and start spreading the message that the MR title & description is the place to make a draft commit message.

    Or, we decouple commit message mentions from issue credit and don’t worry about having them (mostly) match.

  • 🇪🇸Spain fjgarlin

    We could build in the new system a message suggestion that could be copy/pasted into the MR description if desired, otherwise give freedom to do any commit message since the credits are decoupled from it.

  • Status changed to RTBC 7 months ago
  • 🇳🇿New Zealand quietone

    Yes, catch is right this needs a new issue for discussion. I have created 🌱 [policy] Decide on format of commit message Active for that. And as he pointed out much of the discussion here was about credit and that is now outdated.

    I am not sure if this should be Closed as fixed or outdated. Someone else may know and I will think about that. In the meantime I am setting to RTBC.

  • Status changed to Closed: outdated 7 months ago
  • 🇬🇧United Kingdom catch

    Hmm there was useful discussion here, but we never changed the commit message format - credit was implemented purely on the d.o side and commit messages remained the same. I think we should close it as outdated (original intention was done but in a very different way), and move onto the issue to actually improve the commit message format which @quietone linked.

Production build 0.71.5 2024