samg / timetrap

Simple command line timetracker
http://rubygems.org/gems/timetrap
Other
1.48k stars 116 forks source link

t out does not checkout task in not current sheet even when auto_checkout is true #79

Closed vlcinsky closed 10 years ago

vlcinsky commented 10 years ago

This relates to auto_checkout feature described in issue #52

Content of my ~/.timetrap.yml file:


---
database_file: /home/javl/.timetrap.db
round_in_seconds: 900
append_notes_delimiter: ! '; '
formatter_search_paths:
- /home/javl/.timetrap/formatters
default_formatter: text
default_command: 
auto_checkout: true
day_length_hours: 8
progress_width: 60

So the auto_checkout is true I did not touch this configuration for very long time and it used to work without problem.

Switch to sheet ttt and check in:

$ t s ttt
Switching to sheet "ttt"
$ t in test entry
Checked out of sheet `qqq`.
Checked into sheet `ttt`.

Switch to sheet qqq and check in:

$ t s qqq
Switching to sheet "qqq"
$ t in other test entry
Checked out of sheet "ttt".
Checked into sheet "qqq".

Switching back to previous sheet and call t now:

$ t s -
Switching to sheet "ttt"
$ t now
*ttt: not running
 qqq: 0:00:05 (other test entry)

Trying to checkout now:

$ t out
No running entry on sheet "ttt".

This was supposed to checkout whichever current task was running, but it sounds like a complain. Check t now again

javl@zen:~$ t now
*ttt: not running
 qqq: 0:00:10 (other test entry)

Yes, the entry on sheet qqq is still running. And as auto_checkout is true, it was supposed to be stopped.

I am using latest version of timetrap:

t --version
t: version dated 2013-12-12 11:02:35 +0100
samg commented 10 years ago

I hadn't originally considered that behavior to be part of the auto_checkout feature, but I think you're right that it makes sense. The whole point of auto_checkout is that you shouldn't have to worry about which sheet is active or about having multiple entries running concurrently.

I've updated the behavior and docs to check out of all sheets when t out is invoked and auto_checkout is enabled. I'll probably try to push a new version of the gem in the next few days. Let me know what you think and if you have any comments of feedback on these changes.

Thanks!

samg commented 10 years ago

I just pushed this change out in version 1.8.12. Thanks!

vlcinsky commented 10 years ago

Thanks Sam. You did great job. Now it is exactly as I expected that. In fact, I was using it that way for really long time, so I wonder, what background processes were keeping my logs in shape (or what a mess I shall expect, if I really check them).

I always dream of sending a Happy New Year wishes in form of something handy and practical. You did that with your 1.8.12 of timetrap.

Let your time to be trapped where you wish or where it serves best to you. Happy New Year.

Jan