taskwarrior icon indicating copy to clipboard operation
taskwarrior copied to clipboard

Feature request: recursive dependency filter

Open yoshi1123 opened this issue 2 years ago • 1 comments

Is there a filter for tasks that depend, directly or indirectly, on a specific task? I know of this issue which deals with only direct dependencies: #2193.

Imaginary example:

$ task add save princess              # (1)
$ task add depends:1 defeat bowser    # (2)
$ task add depends:2 find the castle  # (3)
$ task add mow the lawn               # (4)
$ task depends:1                      # show all tasks that depend on task 1
ID Deps Description
-- ---- -----------
 1      save princess
 2 1    defeat bowser
 3 2    find the castle

yoshi1123 avatar Apr 14 '22 12:04 yoshi1123

To retrieve dependencies in a non-recursive manner I do this:

$ task $(task _get 1.depends | tr ',' '\n') list

I'm not sure how to do it recursively from the task command, but I've made a Python snippet that does what you're looking for, here: https://gist.github.com/Matt-Deacalion/5c3731966734be34fa49fd9db1cdf67a (requires tasklib)

I would love an inbuilt filter for this though.

Matt-Deacalion avatar Dec 11 '22 14:12 Matt-Deacalion