17b94a
From 1f03327887645be2500cd29f69f7a77a4f5d0164 Mon Sep 17 00:00:00 2001
17b94a
From: Rinku Kothiya <rkothiya@redhat.com>
17b94a
Date: Mon, 18 Nov 2019 14:25:12 -0500
17b94a
Subject: [PATCH 318/335] Update rfc.sh to rhgs-3.5.1
17b94a
17b94a
Removed the checks for updates and fixes from rfc.sh
17b94a
17b94a
Label: DOWNSTREAM ONLY
17b94a
17b94a
Change-Id: I436c959aa3b3366cd313b29f41c2466c4072efd7
17b94a
Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
17b94a
---
17b94a
 rfc.sh | 47 ++++++++---------------------------------------
17b94a
 1 file changed, 8 insertions(+), 39 deletions(-)
17b94a
17b94a
diff --git a/rfc.sh b/rfc.sh
17b94a
index 69ddd2b..918fb11 100755
17b94a
--- a/rfc.sh
17b94a
+++ b/rfc.sh
17b94a
@@ -129,13 +129,8 @@ editor_mode()
17b94a
 
17b94a
     if [ $(basename "$1") = "COMMIT_EDITMSG" ]; then
17b94a
         # see note above function warn_reference_missing for regex elaboration
17b94a
-        # Lets first check for github issues
17b94a
-        ref=$(git log -n1 --format='%b' | grep -ow -E "([fF][iI][xX][eE][sS]|[uU][pP][dD][aA][tT][eE][sS])(:)?[[:space:]]+(gluster\/glusterfs)?#[[:digit:]]+" | awk -F '#' '{print $2}');
17b94a
-        if [ "x${ref}" = "x" ]; then
17b94a
-            # if not found, check for bugs
17b94a
-            ref=$(git log -n1 --format='%b' | grep -ow -E "([fF][iI][xX][eE][sS]|[uU][pP][dD][aA][tT][eE][sS])(:)?[[:space:]]+bz#[[:digit:]]+" | awk -F '#' '{print $2}');
17b94a
-        fi
17b94a
 
17b94a
+        ref=$(git log -n1 --format='%b' | grep -ow -E "^[bB][uU][gG](:)[[:space:]]+[[:digit:]]+")
17b94a
         if [ "x${ref}" != "x" ]; then
17b94a
             return;
17b94a
         fi
17b94a
@@ -157,16 +152,6 @@ editor_mode()
17b94a
                 bz_string=""
17b94a
             fi
17b94a
 
17b94a
-            echo "Select yes '(y)' if this patch fixes the bug/feature completely,"
17b94a
-            echo -n "or is the last of the patchset which brings feature (Y/n): "
17b94a
-            read fixes
17b94a
-            fixes_string="fixes"
17b94a
-            if [ "${fixes}" = 'N' ] || [ "${fixes}" = 'n' ]; then
17b94a
-                fixes_string="updates"
17b94a
-            fi
17b94a
-
17b94a
-            sed "/^Change-Id:/{p; s/^.*$/${fixes_string}: ${bz_string}#${bug}/;}" $1 > $1.new && \
17b94a
-                mv $1.new $1;
17b94a
             return;
17b94a
         done
17b94a
     fi
17b94a
@@ -234,8 +219,8 @@ check_patches_for_coding_style()
17b94a
 #   IOW, the above helps us find the pattern with leading or training spaces
17b94a
 #   or non word consituents like , or ;
17b94a
 #
17b94a
-#   [fF][iI][xX][eE][sS]|[uU][pP][dD][aA][tT][eE][sS])
17b94a
-#      Finds 'fixes' OR 'updates' in any case combination
17b94a
+#   [bB][uU][gG]
17b94a
+#      Finds 'bug' in any case
17b94a
 #
17b94a
 #   (:)?
17b94a
 #      Followed by an optional : (colon)
17b94a
@@ -256,28 +241,11 @@ warn_reference_missing()
17b94a
     echo ""
17b94a
     echo "=== Missing a reference in commit! ==="
17b94a
     echo ""
17b94a
-    echo "Gluster commits are made with a reference to a bug or a github issue"
17b94a
-    echo ""
17b94a
-    echo "Submissions that are enhancements (IOW, not functional"
17b94a
-    echo "bug fixes, but improvements of any nature to the code) are tracked"
17b94a
-    echo "using github issues [1]."
17b94a
+    echo "You must give BUG: <bugid>"
17b94a
     echo ""
17b94a
-    echo "Submissions that are bug fixes are tracked using Bugzilla [2]."
17b94a
+    echo "for example:"
17b94a
     echo ""
17b94a
-    echo "A check on the commit message, reveals that there is no bug or"
17b94a
-    echo "github issue referenced in the commit message"
17b94a
-    echo ""
17b94a
-    echo "[1] https://github.com/gluster/glusterfs/issues/new"
17b94a
-    echo "[2] https://bugzilla.redhat.com/enter_bug.cgi?product=GlusterFS"
17b94a
-    echo ""
17b94a
-    echo "Please file an issue or a bug report and reference the same in the"
17b94a
-    echo "commit message using the following tags:"
17b94a
-    echo "GitHub Issues:"
17b94a
-    echo "\"Fixes: gluster/glusterfs#n\" OR \"Updates: gluster/glusterfs#n\","
17b94a
-    echo "\"Fixes: #n\" OR \"Updates: #n\","
17b94a
-    echo "Bugzilla ID:"
17b94a
-    echo "\"Fixes: bz#n\" OR \"Updates: bz#n\","
17b94a
-    echo "where n is the issue or bug number"
17b94a
+    echo "BUG: 1234567"
17b94a
     echo ""
17b94a
     echo "You may abort the submission choosing 'N' below and use"
17b94a
     echo "'git commit --amend' to add the issue reference before posting"
17b94a
@@ -312,7 +280,7 @@ main()
17b94a
     assert_diverge;
17b94a
 
17b94a
     # see note above function warn_reference_missing for regex elaboration
17b94a
-    reference=$(git log -n1 --format='%b' | grep -ow -E "([fF][iI][xX][eE][sS]|[uU][pP][dD][aA][tT][eE][sS])(:)?[[:space:]]+(gluster\/glusterfs)?(bz)?#[[:digit:]]+" | awk -F '#' '{print $2}');
17b94a
+    reference=$(git log -n1 --format='%b' | grep -ow -E "^[bB][uU][gG](:)[[:space:]]+[[:digit:]]+" | awk  '{print $2}')
17b94a
 
17b94a
     # If this is a commit against master and does not have a bug ID or a github
17b94a
     # issue reference. Warn the contributor that one of the 2 is required
17b94a
@@ -320,6 +288,7 @@ main()
17b94a
         warn_reference_missing;
17b94a
     fi
17b94a
 
17b94a
+
17b94a
     # TODO: add clang-format command here. It will after the changes are done everywhere else
17b94a
     clang_format=$(clang-format --version)
17b94a
     if [ ! -z "${clang_format}" ]; then
17b94a
-- 
17b94a
1.8.3.1
17b94a