diff options
author | Amar Tumballi <amarts@redhat.com> | 2018-09-05 09:10:39 +0530 |
---|---|---|
committer | gluster-ant <bugzilla-bot@gluster.org> | 2018-09-05 09:10:39 +0530 |
commit | 75cae9dc36174996f83ece87306e72d0e13e473e (patch) | |
tree | 130eccd5f3bffa8d427a9fcacd9ebdc5c65b5dad /rfc.sh | |
parent | 027c1b4eefa33535f234a738be4eac86a00afd67 (diff) | |
download | glusterfs-75cae9dc36174996f83ece87306e72d0e13e473e.tar.gz glusterfs-75cae9dc36174996f83ece87306e72d0e13e473e.tar.xz glusterfs-75cae9dc36174996f83ece87306e72d0e13e473e.zip |
rfc.sh: use 'git log -n1' instead of 'git show'
This is required mainly because if we use any format in a
documentation, and it has strings which are looking for commit
msg format (like fixes: bz...) in document, that too will be
considered in checks, even though it is not part of commit msg.
By using git log -n1, we would only check the content of commit
msg.
Updates: bz#1193929
Change-Id: I498590de6d3daa6be7bcbee1f083ef3fa6ecc96f
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'rfc.sh')
-rwxr-xr-x | rfc.sh | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -78,7 +78,7 @@ check_backport() fi # Extract the change ID from the commit message - changeid=$(git show --format='%b' | grep -i '^Change-Id: ' | awk '{print $2}') + changeid=$(git log -n1 --format='%b' | grep -i '^Change-Id: ' | awk '{print $2}') # If there is no change ID ask if we should continue if [ -z "$changeid" ]; then @@ -130,10 +130,10 @@ editor_mode() if [ $(basename "$1") = "COMMIT_EDITMSG" ]; then # see note above function warn_reference_missing for regex elaboration # Lets first check for github issues - ref=$(git show --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}'); + 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}'); if [ "x${ref}" = "x" ]; then # if not found, check for bugs - ref=$(git show --format='%b' | grep -ow -E "([fF][iI][xX][eE][sS]|[uU][pP][dD][aA][tT][eE][sS])(:)?[[:space:]]+bz#[[:digit:]]+" | awk -F '#' '{print $2}'); + 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}'); fi if [ "x${ref}" != "x" ]; then @@ -312,7 +312,7 @@ main() assert_diverge; # see note above function warn_reference_missing for regex elaboration - reference=$(git show --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}'); + 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}'); # If this is a commit against master and does not have a bug ID or a github # issue reference. Warn the contributor that one of the 2 is required |