From 82179494ece375e0f2e59a519fba4f1b152b2123 Mon Sep 17 00:00:00 2001 From: Norbert Kalmar Date: Mon, 13 May 2019 17:06:40 +0200 Subject: [PATCH 1/2] HBASE-22311 - Update community docs to recommend use of "Co-authored-by" in git commits --- src/main/asciidoc/_chapters/developer.adoc | 32 +++++++++++++++++----- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/src/main/asciidoc/_chapters/developer.adoc b/src/main/asciidoc/_chapters/developer.adoc index a15a9e6197c7..0eb3a7b83026 100644 --- a/src/main/asciidoc/_chapters/developer.adoc +++ b/src/main/asciidoc/_chapters/developer.adoc @@ -2300,19 +2300,37 @@ message is in their patch and you can use that, but be sure the JIRA ID is at the front of the commit message, even if the contributor left it out. [[committer.amending.author]] -====== Add Amending-Author when a conflict cherrypick backporting +====== Use GitHub's "Co-authored-by" when there are multiple authors We've established the practice of committing to master and then cherry picking back to branches whenever possible, unless * it's breaking compat: In which case, if it can go in minor releases, backport to branch-1 and branch-2. * it's a new feature: No for maintenance releases, For minor releases, discuss and arrive at consensus. -When there is a minor conflict we can fix it up and just proceed with the commit. -The resulting commit retains the original author. -When the amending author is different from the original committer, add notice of this at the end of the commit message as: `Amending-Author: Author - ` See discussion at link:http://search-hadoop.com/m/DHED4wHGYS[HBase, mail # dev - - [DISCUSSION] Best practice when amending commits cherry picked - from master to branch]. +There are occasions when there are multiple author for a patch. +For example when there is a minor conflict we can fix it up and just proceed with the commit. +The amending author will be different from the original committer, so you should also attribute to the original author by +adding one or more `Co-authored-by` trailers to the commit's message. +See link:https://help.github.com/en/articles/creating-a-commit-with-multiple-authors/[the GitHub documentation for "Creating a commit with multiple authors"]. + +In short, these are the steps to add Co-authors that will be tracked by GitHub: + +. Collect the name and email address for each co-author. +. Commit the change, but after your commit description, instead of a closing quotation, add two empty lines. (Do not close the commit message with a quotation mark) +. On the next line of the commit message, type `Co-authored-by: name `. After the co-author information, add a closing quotation mark. + +Here is the example from the GitHub page, using 2 Co-authors: +[source,xml] +---- +$ git commit -m "Refactor usability tests. +> +> +Co-authored-by: name +Co-authored-by: another-name " +---- + +Note: `Amending-Author: Author ` was used prior to this +link:https://lists.apache.org/thread.html/f00b5f9b65570e777dbb31c37d7b0ffc55c5fc567aefdb456608a042@%3Cdev.hbase.apache.org%3E[DISCUSSION]. ====== Close related GitHub PRs From fcdd5833fb7cfc4c2ba89f5d7980d7169822b73c Mon Sep 17 00:00:00 2001 From: Norbert Kalmar Date: Wed, 15 May 2019 15:21:40 +0200 Subject: [PATCH 2/2] HBASE-22311 - fix typo --- src/main/asciidoc/_chapters/developer.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/asciidoc/_chapters/developer.adoc b/src/main/asciidoc/_chapters/developer.adoc index 0eb3a7b83026..a470f65c41a6 100644 --- a/src/main/asciidoc/_chapters/developer.adoc +++ b/src/main/asciidoc/_chapters/developer.adoc @@ -2329,7 +2329,7 @@ Co-authored-by: name Co-authored-by: another-name " ---- -Note: `Amending-Author: Author ` was used prior to this +Note: `Amending-Author: Author ` was used prior to this link:https://lists.apache.org/thread.html/f00b5f9b65570e777dbb31c37d7b0ffc55c5fc567aefdb456608a042@%3Cdev.hbase.apache.org%3E[DISCUSSION]. ====== Close related GitHub PRs