Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want to be able to exclude certain tags from reports #209

Open
hiliev opened this issue Feb 26, 2019 · 9 comments
Open

I want to be able to exclude certain tags from reports #209

hiliev opened this issue Feb 26, 2019 · 9 comments
Labels
enhancement New feature or request

Comments

@hiliev
Copy link

hiliev commented Feb 26, 2019

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.

@lauft lauft added the enhancement New feature or request label Mar 2, 2019
@hiliev
Copy link
Author

hiliev commented Mar 3, 2019

I have a PoC implementation of filtering with "negative" tags here: hiliev@025b36c
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.

@lauft
Copy link
Member

lauft commented Mar 3, 2019

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.

@hiliev
Copy link
Author

hiliev commented Mar 3, 2019

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?

@bertrand-benoit
Copy link

+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).

@pchr8
Copy link

pchr8 commented Sep 28, 2019

+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).

@nodens
Copy link
Sponsor

nodens commented Mar 6, 2020

Just +1-ing here, that'd be really useful (my own reason of doing that is in #297)

@gertjandemulder
Copy link

+1

@sjfloat
Copy link

sjfloat commented Feb 6, 2023

+1 I reach for this daily.

@LiyinZ
Copy link

LiyinZ commented Jul 11, 2023

Naturally I tried -tag and then encounter the same problem and found this thread. +1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants