You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The topic of negative time ranges keeps coming up, so I think klog eventually should have that. There was some discussion happening already in #109. This ticket is for discussing and figuring out some details of the feature, so please free to add comments about whatever comes to mind.
The implementation is fairly comprehensive, and the spec also needs changing – so I don’t know when I’ll get around to starting it, let alone when it’s done.
File format
Notation
I think what’s mostly clear is that the negative time range needs to be preceded by a minus sign -. There should also be a clear visual distinction in regards to regular time ranges. The following options are on the table right now:
2000-01-01
-(15:00-16:00)
-[15:00-16:00]
Parentheses ():
That’s both common as mathematical notation but also in daily writing, so it seems intuitive.
Parenthesis are already used for should totals (8h!), so it might create ambiguity – but maybe not since the should total is in a different place and obviously serves a different purpose.
Square brackets []:
Also used in math as notation for inclusive intervals (which would be the case here).
Might look more “technical”, as square brackets are less common than parentheses in daily writing.
In the end, there should be only one of these notations.
Open negative time range
Regular time ranges can be open (15:00-?), so it would make sense for negative time ranges to be able to be open as well.
Records are currently constrained to one open time range at most. Likewise, there should be just one open negative time range. But it would make sense for both to allow that independent of each other, to support something like:
2000-01-01
8:00-? Work
-(12:00-?) Lunch break
Otherwise, you would have to close the Work entry before starting a break, and you probably don’t want that.
Whitespace
Time ranges can have spaces around the dash (15:00-16:00 vs 15:00 - 16:00, both fine). Negative time ranges can have that as well. But what about:
- (15:00 - 16:00)
I’m tending to think this shouldn’t be allowed, as you could confuse it with a bullet point. I also don’t see any good reason for it.
-( 15:00 - 16:00 )
Maybe people prefer some padding inside the parenthesis? Maybe nothing wrong with this?
CLI tool
klog pause
The klog pause command currently opens a negative duration and keeps decrementing that. Once negative time ranges are there, klog pause should probably default to starting an open negative time range, so the semantics could be changed as follows:
klog pause would default to append a new negative open range to the record. (I.e., the counterpart of klog start.)
klog pause --follow (klog pause -f) would do the same, but keep the shell process open. Once you hit ^C, the open entry is closed.
klog pause --duration (klog pause -d) would be the “old” behaviour. (--follow/-f would be implicit here, so you can specify it as well, but also omit it, for convenience.)
There also would need to be a new command for finishing the negative open range, e.g. klog unpause or klog resume. (I.e., the counterpart of klog stop.)
The text was updated successfully, but these errors were encountered:
From my perspective, that's a must-have — what I'm missing/would use them for.
Whitespace
- (15:00 - 16:00)
Definitely disallow.
-( 15:00 - 16:00 )
I'd never use it and probably wouldn't support it, but like you say, it's hard to argue against it. I suppose you could choose not to support it initially and await popular demand?
CLI tool
The klog pause command currently opens a negative duration and keeps decrementing that. Once negative time ranges are there, klog pause should probably default to starting an open negative time range. The current behaviour could still be preserved via e.g. klog pause --duration or so. There also would need to be a new command then for finishing the pause, e.g. klog resume or so. (So in the end, there need to be the pause-equivalents for klog start and klog stop.)
The topic of negative time ranges keeps coming up, so I think klog eventually should have that. There was some discussion happening already in #109. This ticket is for discussing and figuring out some details of the feature, so please free to add comments about whatever comes to mind.
The implementation is fairly comprehensive, and the spec also needs changing – so I don’t know when I’ll get around to starting it, let alone when it’s done.
File format
Notation
I think what’s mostly clear is that the negative time range needs to be preceded by a minus sign
-
. There should also be a clear visual distinction in regards to regular time ranges. The following options are on the table right now:()
:(8h!)
, so it might create ambiguity – but maybe not since the should total is in a different place and obviously serves a different purpose.[]
:In the end, there should be only one of these notations.
Open negative time range
Regular time ranges can be open (
15:00-?
), so it would make sense for negative time ranges to be able to be open as well.Records are currently constrained to one open time range at most. Likewise, there should be just one open negative time range. But it would make sense for both to allow that independent of each other, to support something like:
Otherwise, you would have to close the
Work
entry before starting a break, and you probably don’t want that.Whitespace
Time ranges can have spaces around the dash (
15:00-16:00
vs15:00 - 16:00
, both fine). Negative time ranges can have that as well. But what about:- (15:00 - 16:00)
-( 15:00 - 16:00 )
CLI tool
klog pause
The
klog pause
command currently opens a negative duration and keeps decrementing that. Once negative time ranges are there,klog pause
should probably default to starting an open negative time range, so the semantics could be changed as follows:klog pause
would default to append a new negative open range to the record. (I.e., the counterpart ofklog start
.)klog pause --follow
(klog pause -f
) would do the same, but keep the shell process open. Once you hit^C
, the open entry is closed.klog pause --duration
(klog pause -d
) would be the “old” behaviour. (--follow
/-f
would be implicit here, so you can specify it as well, but also omit it, for convenience.)There also would need to be a new command for finishing the negative open range, e.g.
klog unpause
orklog resume
. (I.e., the counterpart ofklog stop
.)The text was updated successfully, but these errors were encountered: