]> Sergey Matveev's repositories - schwabrak.git/commitdiff
Filter by tags
authorSergey Matveev <stargrave@stargrave.org>
Thu, 14 Mar 2024 12:51:57 +0000 (15:51 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Thu, 14 Mar 2024 12:51:57 +0000 (15:51 +0300)
list

diff --git a/list b/list
index 13cdc7787a937aa9f67d5ee96088593b2237d46527ba2fb7b7375131e93eae0a..4e7fa51b0df11395a2cdabab3029beb011c89df98720b384699200ad84314c53 100755 (executable)
--- a/list
+++ b/list
@@ -3,9 +3,24 @@
 root=$0:h:a
 . $root/lib.zsh.rc
 
+tagsOur=($@)
+
 for issue (issues/**/created) {
     issue=$issue:h
     issue=${issue#issues/}
+
+    tagsTheir=(`$root/tag-list $issue`)
+    tagsFound=0
+    for our ($tagsOur) {
+        for their ($tagsTheir) {
+            if [[ $their =~ $our ]] ; then
+                tagsFound=$(( $tagsFound + 1 ))
+                break
+            fi
+        }
+    }
+    [[ $tagsFound -eq ${#tagsOur} ]] || continue
+
     print -n `cat issues/$issue/created`\\t$issue\\t
-    print `$root/tag-list $issue`
+    print $tagsTheir
 } | sort -r