timewarrior
timewarrior copied to clipboard
I want to be able to exclude certain tags from reports
I find the combination of Taskwarrior and Timewarrior really great, but there is a minor inconvenience in the way TImewarrior works. In Taskwarrior--and that doesn't seem to be properly documented--one can use exclude filters with something like -tag
to filter out tasks that have a particular tag. The same functionality doesn't seem to be supported in Timewarrior, which instead treats -
in -tag
as part of the tag name.
Use case: I use my desktop computer mainly for work, but from time to time I do some tasks that are not related to work. Those tasks are a relatively low in number and I tag them private
. I would like to be able to exclude them from the reports. Currently, the only options are to tag all other tasks as work
and then use timew summary work
or to manually subtract the time for private tasks from the totals, which doesn't work for reports. It would be easier if I could just do something like timew month -private
.
I have a PoC implementation of filtering with "negative" tags here: https://github.com/hiliev/timewarrior/commit/025b36c051c70fef2beeb456df5ef9ad9221f2e9
It pushes the logic for handling negative tags inside Interval::has
, basically defining that an interval has a negative tag if it doesn't have the tag itself.
If you consider this a viable solution, I'd be glad to submit a PR. It doesn't seem to break any of the current tests.
I do not think the Interval::has
function is the right place for filtering logic, especially if one wants to combine it with some other filtering like or
or and
as requested in #64.
I totally get it that mine is not a universal solution since --tag
does not equal tag
, though it should otherwise work in arbitrary boolean expressions as long as the logic is implemented in matchesFilter
and a minus sign is kept as part of the tag name after the expression is simplified. Speaking of universality, what are the chances of a Taskwarrior-style expression engine making its way into Timewarrior anytime soon?
+1
I would like to be able to get a report "all tasks which do not have this tag" ...
For instance, it can be very useful to get/show the list of tasks which may be an interference to a project (the hereby named tag).
+1!
I really miss a "summary for all intervals today except the ones tagged X". In general due to the way my tags are organized I would benefit immensely from boolean logic in reports (or just NOT).
Just +1-ing here, that'd be really useful (my own reason of doing that is in #297)
+1
+1 I reach for this daily.
Naturally I tried -tag
and then encounter the same problem and found this thread. +1