[Mesa-dev] [PATCH v2] bugzilla_mesa.sh: sort the bugs list by number

Emil Velikov emil.l.velikov at gmail.com
Tue Jun 30 09:32:04 PDT 2015


v2: Use another sed pattern as per Ilia's suggestion.

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---

Ilia's approach seems to be slightly faster than Chad's so I've went 
ahead with it.

-Emil


 bin/bugzilla_mesa.sh | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/bin/bugzilla_mesa.sh b/bin/bugzilla_mesa.sh
index be47fc0..0cff426 100755
--- a/bin/bugzilla_mesa.sh
+++ b/bin/bugzilla_mesa.sh
@@ -15,17 +15,14 @@
 # $ DRYRUN=yes bin/bugzilla_mesa.sh mesa-9.0.2..mesa-9.0.3 | wc -l
 
 
-# regex pattern: trim before url
-trim_before='s/.*\(http\)/\1/'
+# regex pattern: trim before bug number
+trim_before='s/.*show_bug.cgi?id=\([0-9]*\).*/\1/'
 
-# regex pattern: trim after url
-trim_after='s/\(show_bug.cgi?id=[0-9]*\).*/\1/'
-
-# regex pattern: always use https
-use_https='s/http:/https:/'
+# regex pattern: reconstruct the url
+use_after='s,^,https://bugs.freedesktop.org/show_bug.cgi?id=,'
 
 # extract fdo urls from commit log
-urls=$(git log $* | grep 'bugs.freedesktop.org/show_bug' | sed -e $trim_before -e $trim_after -e $use_https | sort -n --unique --key=2 --field-separator==)
+urls=$(git log $* | grep 'bugs.freedesktop.org/show_bug' | sed -e $trim_before | sort -n -u | sed -e $use_after)
 
 # if DRYRUN is set to "yes", simply print the URLs and don't fetch the
 # details from fdo bugzilla.
-- 
2.4.4



More information about the mesa-dev mailing list