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

Allow tracking "nested intervals" #503

Open
guludo opened this issue Sep 15, 2022 · 3 comments
Open

Allow tracking "nested intervals" #503

guludo opened this issue Sep 15, 2022 · 3 comments
Labels
discussion Discussion on a topic

Comments

@guludo
Copy link

guludo commented Sep 15, 2022

Consider the following use case:

A user is working on multiple projects and is using taskwarrior to track time spent on each project. Let's say that project A uses a ticketing system and the user would like to be able to use taskwarrior to track time spent on each ticket. Since the user is already tracking time on project A, taskwarrior can't be used to track the ticket time, because timew start will cause the tracking of project A to stop.

To solve that, we could allow "nested intervals" to be recorded. This would turn timewarrior into a "hierarchical" time-tracking system.

@smemsh
Copy link
Contributor

smemsh commented Sep 15, 2022

Intervals can each have arbitrary tags, so you can just add whatever tags you want to be associated with those intervals, to implement a hierarchical view of those tags. I use /tags/like/this but then also would put the tags /tags/like/ and /tags/ on that same interval. This way I can query all intervals collectively at different levels of hierarchy, or the tasks themselves. "Leaf" tags are those without a trailing slash, and represent a single thing worked on. YMMV...

@lauft lauft added the discussion Discussion on a topic label Sep 27, 2022
@guludo
Copy link
Author

guludo commented Oct 5, 2022

@smemsh That could work, but, if I understand it correctly, that would require me listing every level of the hierarchy in the command line, right? Example:

timew start /a # Start working on a: non-specific tasks
timew start /a /a/b # Start to work specifically on b
timew start /a /a/c # Stop b and start c
timew stop

If we added the ability to use nested intervals, we could do something like below:

timew start /a
timew push /a/b  # Start nested interval
timew pop # Stop nested interval
timew push /a/c
timew pop
timew stop

As with the current version, the structure of the names of the tags would be transparent to timewarrior, the user could use whatever tag she wanted. What would tell timewarrior that we are nesting intervals would be the push subcommand.

@smemsh
Copy link
Contributor

smemsh commented Oct 5, 2022

That could work, but, if I understand it correctly, that would require me listing every level of the hierarchy in the command line, right? Example:
timew start /a # Start working on a: non-specific tasks
timew start /a /a/b # Start to work specifically on b
timew start /a /a/c # Stop b and start c
timew stop

Personally I only work on leaf tasks, and don't use containers. However the containers are emergent based on the tags, which for me are installed automatically via wrappers and triggers, so I don't have to write them all. These extra tags are useful for accounting or selection after the fact, but not for logging. I feel there is only one task worked at a time so nesting them per se doesn't make sense for my work flow. Therefore I only use leaves. If I need to tally time spent on related tasks that share some hierarchy, I can do that (such as, for tasks a/1, a/2, and a/3, they would all have tag a/ so I can sum that one to get their combined total or otherwise select all a/ prefixed tags).

But, I do get your suggestion and can see that some might find it useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussion on a topic
Projects
None yet
Development

No branches or pull requests

3 participants