[Gluster-devel] Fix bug-id extraction in compare-bug-version-and-git-branch
Niels de Vos
ndevos at redhat.com
Thu May 28 08:37:50 UTC 2015
On Thu, May 28, 2015 at 11:54:03AM +0530, Kaushal M wrote:
> The bug-id extraction method in the compare-bug-version-and-git-branch
> was buggy. Which lead to some valid changes being marked as invalid.
> [1],[2]
>
> The following snippet was used
> ```
> BUG=$(git show --name-only --format=email | grep -i '^BUG: ' | cut -f2
> -d ' ' | tail -1)
> ```
>
> The problem is with the usage of `cut`, which as used here cannot
> handle multiple whitespace between 'BUG: ' and the ID.
>
> I'll replac `cut` with `awk` which should work better. The snippet now
> looks like
> ```
> BUG=$(git show --name-only --format=email | awk '{IGNORECASE=1}
> /^BUG:/{print $2}' | tail -1)
> ```
> This should work much better.
Looks good to me. Please update or send a pull request for it too. It
would be aweful if the Jenkins job and the archived script get out of
sync:
https://github.com/gluster/glusterfs-patch-acceptance-tests/
Thanks,
Niels
>
> ~kaushal
>
> [1]: https://review.gluster.org/10797
> [2]: https://review.gluster.org/10849
> _______________________________________________
> Gluster-devel mailing list
> Gluster-devel at gluster.org
> http://www.gluster.org/mailman/listinfo/gluster-devel
More information about the Gluster-devel
mailing list