]> granicus.if.org Git - zfs/commitdiff
commitcheck: Multiple OpenZFS ports in commit
authorGiuseppe Di Natale <dinatale2@users.noreply.github.com>
Thu, 26 Oct 2017 17:23:58 +0000 (10:23 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 26 Oct 2017 17:23:58 +0000 (10:23 -0700)
Allow commitcheck.sh to handle multiple OpenZFS ports in
a single commit. This is useful in the cases when a change
upstream has bug fixes and it makes sense to port them with
the original patch.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Chris Dunlop <chris@onthe.net.au>
Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Closes #6780

.github/CONTRIBUTING.md
scripts/commitcheck.sh

index ab64c0c0e1cc95d4a70fe1213504d5ffa330282a..a74eb553556ffbfee2ffee600001c8fa6b165a02 100644 (file)
@@ -186,23 +186,23 @@ Signed-off-by: Contributor <contributor@email.com>
 ```
 
 #### OpenZFS Patch Ports
-If you are porting an OpenZFS patch, the commit message must meet
+If you are porting OpenZFS patches, the commit message must meet
 the following guidelines:
-* The first line must be the summary line from the OpenZFS commit.
-It must begin with `OpenZFS dddd - ` where `dddd` is the OpenZFS issue number.
-* Provides a `Authored by:` line to attribute the patch to the original author.
-* Provides the `Reviewed by:` and `Approved by:` lines from the original
+* The first line must be the summary line from the most important OpenZFS commit being ported.
+It must begin with `OpenZFS dddd, dddd - ` where `dddd` are OpenZFS issue numbers.
+* Provides a `Authored by:` line to attribute each patch for each original author.
+* Provides the `Reviewed by:` and `Approved by:` lines from each original
 OpenZFS commit.
 * Provides a `Ported-by:` line with the developer's name followed by
-their email.
-* Provides a `OpenZFS-issue:` line which is a link to the original illumos
+their email for each OpenZFS commit.
+* Provides a `OpenZFS-issue:` line with link for each original illumos
 issue.
-* Provides a `OpenZFS-commit:` line which links back to the original OpenZFS
-commit.
+* Provides a `OpenZFS-commit:` line with link for each original OpenZFS commit.
 * If necessary, provide some porting notes to describe any deviations from
-the original OpenZFS commit.
+the original OpenZFS commits.
 
-An example OpenZFS patch port commit message is provided below.
+An example OpenZFS patch port commit message for a single patch is provided
+below.
 ```
 OpenZFS 1234 - Summary from the original OpenZFS commit
 
@@ -218,6 +218,37 @@ OpenZFS-issue: https://www.illumos.org/issues/1234
 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/abcd1234
 ```
 
+If necessary, multiple OpenZFS patches can be combined in a single port.
+This is useful when you are porting a new patch and its subsequent bug
+fixes. An example commit message is provided below.
+```
+OpenZFS 1234, 5678 - Summary of most important OpenZFS commit
+
+1234 Summary from original OpenZFS commit for 1234
+
+Authored by: Original Author <original@email.com>
+Reviewed by: Reviewer Two <reviewer2@email.com>
+Approved by: Approver One <approver1@email.com>
+Ported-by: ZFS Contributor <contributor@email.com>
+
+Provide some porting notes here for 1234 if necessary.
+
+OpenZFS-issue: https://www.illumos.org/issues/1234
+OpenZFS-commit: https://github.com/openzfs/openzfs/commit/abcd1234
+
+5678 Summary from original OpenZFS commit for 5678
+
+Authored by: Original Author2 <original2@email.com>
+Reviewed by: Reviewer One <reviewer1@email.com>
+Approved by: Approver Two <approver2@email.com>
+Ported-by: ZFS Contributor <contributor@email.com>
+
+Provide some porting notes here for 5678 if necessary.
+
+OpenZFS-issue: https://www.illumos.org/issues/5678
+OpenZFS-commit: https://github.com/openzfs/openzfs/commit/efgh5678
+```
+
 #### Coverity Defect Fixes
 If you are submitting a fix to a
 [Coverity defect](https://scan.coverity.com/projects/zfsonlinux-zfs),
index 1f78dc8a84463a9c971947b2c1b568299e235f11..927f5e737a0c8822e83c479616a64f217261e6ab 100755 (executable)
@@ -51,9 +51,14 @@ function check_tagged_line_with_url()
         return 1
     fi
 
-    if ! test_url "$foundline"; then
-        return 1
-    fi
+    OLDIFS=$IFS
+    IFS=$'\n'
+    for url in $(echo -e "$foundline"); do
+        if ! test_url "$url"; then
+            return 1
+        fi
+    done
+    IFS=$OLDIFS
 
     return 0
 }
@@ -99,7 +104,7 @@ function openzfs_port_commit()
     error=0
 
     # subject starts with OpenZFS dddd
-    subject=$(git log -n 1 --pretty=%s "$REF" | egrep -m 1 '^OpenZFS [[:digit:]]+ - ')
+    subject=$(git log -n 1 --pretty=%s "$REF" | egrep -m 1 '^OpenZFS [[:digit:]]+(, [[:digit:]]+)* - ')
     if [ -z "$subject" ]; then
         echo "error: OpenZFS patch ports must have a subject line that starts with \"OpenZFS dddd - \""
         error=1