[Gluster-devel] Fix bug-id extraction in compare-bug-version-and-git-branch

Kaushal M kshlmster at gmail.com
Thu May 28 06:24:03 UTC 2015


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