[Gluster-devel] Fix bug-id extraction in compare-bug-version-and-git-branch
Kaushal M
kshlmster at gmail.com
Thu May 28 06:29:12 UTC 2015
The change is now live. The changes I mentioned above have
successfully passed the job.
On Thu, May 28, 2015 at 11:54 AM, Kaushal M <kshlmster at gmail.com> 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.
>
> ~kaushal
>
> [1]: https://review.gluster.org/10797
> [2]: https://review.gluster.org/10849
More information about the Gluster-devel
mailing list