GothenburgBitFactory / timewarrior

Timewarrior - Commandline Time Tracking and Reporting
https://timewarrior.net
MIT License
1.26k stars 95 forks source link

Allow splitting (active) interval by time #385

Open xeruf opened 4 years ago

xeruf commented 4 years ago

So, if I have an interval running and want to switch to another task or stop, I know to use timew start <tag> or timew stop, respectively. However, since there can only be one annotation per interval, I wanted to split my active interval without changing anything. I know I can use timew stop && timew continue, but something like

timew split now

would be really elegant.

lauft commented 4 years ago

Instead of introducing another command I would add a hint to the start command to override the current behaviour where a start with the same tag set is ignored:

 $ timew start FOO
Note: 'FOO' is a new tag.
Tracking FOO
  Started 2020-09-09T07:57:03
  Current                  03
  Total               0:00:00
$ timew start FOO # call start with the same tag set is ignored
Tracking FOO
  Started 2020-09-09T07:57:04
  Current                  04
  Total               0:00:00
$ timew start FOO :<tbd> #call start with hint
Recorded FOO
  Started 2020-09-09T07:57:03
  Ended                    28
  Total               0:00:25
Tracking FOO
  Started 2020-09-09T07:57:28
  Current                  28
  Total               0:00:00

The :adjust hint might be a candidate, on the other hand it is probably better to reserve this hint for overlap resolution... 🤔

xeruf commented 4 years ago

but this won't be a new command, the split command already exists! And I think splitting by time would be a nice thing in general.

lauft commented 4 years ago

Splitting by time is already on the agenda, see #257.

... I have an interval running and want to switch to another task or stop... since there can only be one annotation per interval, I wanted to split my active interval without changing anything. ...

Reading those lines I thought you wanted to create a new interval with the same tag set, but without the current annotation. With split on the other hand the resulting intervals would all have the annotation of the previous one. This is why I proposed a variant of start.

xeruf commented 4 years ago

Ah yes, that's fair.

An alternative for my use-case would be if you could add multiple annotations (#374) and each gets a timestamp. Basically, I want to more precisely document what I have done when, to see where all my time is going ^^ Though I am considering learning org mode now and potentially employing that, since timewarrior seems to be mainly built for logging when you work rather than what you do.

lauft commented 4 years ago

... timewarrior seems to be mainly built for logging when you work rather than what you do

That is right. Timewarrior is a time tracking tool. For planning you can use Taskwarrior or something else. 🙂

xeruf commented 4 years ago

No, I don't mean planning, I mean logging, taskwarrior doesn't really fulfill that. But I guess some notes in my favorite editor should suffice.

sruffell commented 4 years ago

I use our billing codes for my tags, and for the general "overhead" code, I use the annotations in timewarrior.

Like you suggested, I use timew stop && timew continue && timew annotate 'This is the new thing' in order to create a new record with the same tags but different annotation.

I'm looking forward to when the annotations can be specified on the command line, so that a start command with a new annotation will create a new interval.

For more detailed logging I use jrnl: https://jrnl.sh/

xeruf commented 4 years ago

@sruffell thanks for that pointer, I have sort of already started coding a simpler version of this, but that seems much nicer! However, I don't necessarily want all work-logs I am adding when trying to figure out a problem in my journal.