-
Notifications
You must be signed in to change notification settings - Fork 39
Introduce second-precision
feature to Bartib
#70
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
Introduce second-precision
feature to Bartib
#70
Conversation
…sion feature gate
…in under a minute
…ferent feature-gated versions of Bartib
…tamp precision and the actual timestamp precision
I have to head to bed now, but I'll be back on tomorrow to post functional test results! |
Thank you for your work! This is something I would have never thought of but I can understand the usecase. I hope I will be able soon to have a look at your changes and merge them. |
This reverts commit cc5327a.
Not sure how thorough of testing you're looking for, but here's a short clip of me using Bartib with second precision in the timestamps: compressed_bartib.mp4Let me know if there's any other functionality you want me to test :) |
Thanks, this looks good! |
What?
This PR introduces a
second-precision
feature to Bartib that allows users who compile the binary from source to record timestamps in their log file and perform report calculations with a precision of seconds instead of a precision of minutes, as is the default.Why?
I use Bartib in my
post-checkout
git hook so I can capture the amount of time I spend on each branch over the course of the day. Sometimes, I have to flip between branches quickly. I see a lot of the following timestamps in my log file:Those logs entries effectively become "lost" minutes, if I am not mistaken. That might not seem like much, but over a period of several months using Bartib, that can amount to potentially hours worth of "lost" minutes.
How?
I didn't want to alter the default timestamp precision for all users, so I put these changes behind the feature gate
second-precision
and preserved all of the old code.Breaking changes?
The only thing that might be considered a breaking change is the changes I made to
data::parse_timepart()
. I added some additional logic to detect if there is a precision mismatch. For example, in the following screenshot,bartib
was compiled without thesecond-precision
flag but has encountered a log with timestamps that have second precision:`bartib_log.txt`
I want to thank you for all of the hard work you put into this crate! This has got to be one of the best organized crates I've seen yet. I was able to make these changes in less than two hours on a single weekend - and everything worked on the first try. I know no higher honor I can given an open source maintainer than that.
Let me know if there are any changes that you'd like me to make! I'm open to feedback :)
Cheers,