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