taskwarrior icon indicating copy to clipboard operation
taskwarrior copied to clipboard

[TW-177] Report sorting by dependency

Open taskwarrior opened this issue 7 years ago • 7 comments

Sean Lynch on 2010-12-25T21:23:42Z says:

Currently, sorting a report by dependency sorts according to the number of the dependent task. This doesn't really give a useful output order and should be done instead according to the actual order of the dependencies.

taskwarrior avatar Feb 12 '18 20:02 taskwarrior

Migrated metadata:

Created: 2010-12-25T21:23:42Z
Modified: 2015-05-20T10:21:17Z

taskwarrior avatar Feb 12 '18 20:02 taskwarrior

David Patrick on 2010-12-27T08:23:46Z says:

Sub-sorting by dependency should be a default behavior. Dependency is one of the clearest sort-drivers, "this comes before this" and creating a report to specifically drive this should be unnecessary under most circumstances. I'm curious what would/should happen if one were to specifically sort by dependency, but I hope that implementation of an "urgency":http://taskwarrior.org/wiki/1/Helper_Commands#_urgency :value master-sort-driver (Next) will make this Feature academic.

taskwarrior avatar Feb 12 '18 20:02 taskwarrior

Paul Beckingham on 2010-12-30T20:44:12Z says:

This issue needs a nice sample data set, and example of how the sorting is to be done. The data set should include:

  • at least one task without dependencies
  • at least one task with multiple dependencies
  • a "diamond" pattern dependency tree

Agree with David that the new "next" report will make some sorting issues go away, but we still need to specify how dependencies affect sorting in other reports.

taskwarrior avatar Feb 12 '18 20:02 taskwarrior

Sean Lynch on 2011-01-10T16:23:36Z says:

I implemented the functionality for sorting by urgency. I'm not so sure it is useful in its current form as an ordering for dependency. Here is the output for a sample project. A task dependency graph is attached.

ID Project     Pri Urg  Deps  Tags Description
21 DepsTesting     25.0            Task1
17 DepsTesting     17.0 19,22      Task4      
19 DepsTesting     17.0 21         Task2      
22 DepsTesting     17.0 21         Task3      
23 DepsTesting     17.0 17,21      Task6      
18 DepsTesting     16.0            Task8
20 DepsTesting     8.0  17         Task5      
24 DepsTesting     8.0  23         Task7      

Urgency takes into account only whether a task is blocking or not and blocked or not. Because of this, tasks on the inside of a dependency chain end up with the same urgency and are arbitrarily ordered. In order for urgency to sort dependencies, it would need to take into account more than just whether a task is blocked and/or blocking.

The problem is, no matter how it's implemented, dependency ordering will always have to traverse the dependency chain. Sorting by dependency needs to be done by doing a graph search up and down the dependency chain. I'm not sure if this would fit well with the idea of urgency and the "next" report.

Certainly urgency is great for finding which task to do next, but for sorting by dependency I think that functionality still needs to be implemented in Table:sort_compare.

taskwarrior avatar Feb 12 '18 20:02 taskwarrior

Paul Beckingham on 2011-09-29T02:58:26Z says:

Deferring to 2.1. This is a good feature, but I currently can't think of a way to make this happen quickly. Nested sorting is going to be very slow.

taskwarrior avatar Feb 12 '18 20:02 taskwarrior

It's really a shame taskwarrior cannot do this. The naive algorithm at least is easy and could be even an opt-in feature.

flavius avatar Jul 20 '23 15:07 flavius