taskwarrior icon indicating copy to clipboard operation
taskwarrior copied to clipboard

tag: (or tags:) filter does not work as expected, matches initial substring of joined tag list?

Open smemsh opened this issue 3 years ago • 3 comments

Virtual tags should have parity with real tags when searched using tags: filter (or eg tags.word: which I'm using to test string for tags membership). No reason virtual tags should need a special syntax +FOO when ordinary tag can be searched using tags:foo.

Ie, following should work:

task tags:PENDING

Otherwise, it requires a special case in wrappers to handle creating filter for virtual tags differently.

smemsh avatar Aug 09 '22 00:08 smemsh

ok, there is actually some difference, with tag:foo taskwarrior adds and ( tag = foo ) and the result list is different from +foo which adds and ( tags _hastag_ prejob ). what's strange is that both of the lists are constrained by the tag foo, but they have quite different counts.

oh, tag:foo is matching the ones that have the first tag as foo, now it makes sense. from the man page for =:

Strings compare equal if the left operand starts with the right operand

so tag: is comparing its value against all the tags combined as a string or something, and cannot actually be used with real tags anyways.

smemsh avatar Sep 16 '22 17:09 smemsh

tag:foo and tags:foo seem to work the same, strangely

smemsh avatar Sep 16 '22 17:09 smemsh

yeah, so either tag or tags ends up as a joined list I guess, of all the tags, as a comma-separated string. so that's why tags.word:foo works? this is my current guess. but virtual tags don't get added to the tag list, apparently

smemsh avatar Sep 16 '22 17:09 smemsh