diff options
author | Amar Tumballi <amarts@redhat.com> | 2018-09-05 09:10:39 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2018-09-10 15:13:11 +0000 |
commit | 77958023ffb26f1b848fd1ab1ea36f730bc1efce (patch) | |
tree | 130eccd5f3bffa8d427a9fcacd9ebdc5c65b5dad | |
parent | 515074156db5492b22ee8db58e0b91caeed8f60c (diff) |
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>
-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 |