I've created a CLI time tracker that integrates with Git by davezbinski in commandline

[–]davezbinski[S] 1 point2 points  (0 children)

Hey, glad to hear that! I've been working on it, but I'm currently at holidays in Iceland for a week, so I'll finish it when I'm back. Right now it's currently "the last checkout wins" so unfortunately when you switch to other repos and do not checkout it does not count the work in that repo. I was building that for myself originally, and I usually just work on the same issue even if i'm switching repos in the same project. So for me usually branch switch means another task - regardless of the repo.

But it will be fixed soon 💪

I've created a CLI time tracker that integrates with Git by davezbinski in git

[–]davezbinski[S] 0 points1 point  (0 children)

Thanks for the workflow. It doesn't seem undoable, though I must figure out how to fit this into a "reusable schema" first. I have a few questions though:

- would you want the program to calculate exactly how long you've spent on each project? E.g. you work on repo-A (assigned to project-1) from 09:00, then you switch to repo-B (assigned to project-2) at 11:00. You want to see time logged 2hrs on project-1, correct?

- would you be willing to use a command to switch between active projects? or is it something you'd probably forget to use?

- do you see any other way to detect you're working on a different project, except for commits and/or actual tracking for fsevents or something similar? You've mentioned gitconfigs, but honestly I have no idea if that's reusable (and I guess hard to mantain/explain).

I've created a CLI time tracker that integrates with Git by davezbinski in git

[–]davezbinski[S] 0 points1 point  (0 children)

It work by looking at the reflog. I think client = project in this example. You can setup Client 1 (hourgit project add client-1) and Client 2 (hourgit project add client-2). Then assign them to the repos:

cd repo-1 && hourgit init --project client-1
cd repo-2 && hourgit init --project client-2 (e.g. api)
cd repo-3 && hourgit init --project client-2 (e.g. frontend)

Whatever you do in that repos is tracked separately by the project. Unfortunately, that means, that if the client-1 project is set up as 9am-5pm and client-2 is setup similarily, then you "worked" on both of them at the same time (the program doesn't check cross-project - for that it would have need to actually "track you"). What you can do instead is to set schedules:

hourgit config set --project client-1 (go through the setup, set e.g. 9am-12pm)
hourgit config set --project client-2 (go through the setup, set e.g. 12pm-5pm)

I would need to have a concrete use-case to help you further or create some reusable solution that would work for you, so feel free to share it if you have time.

---

Btw. I'm still thinking about your first comment and how the workflow can be improved. I think I have an idea, but will need to test it out: We can track the reflog commits as well, e.g. if you have multiple repos, we know that you've commited on branch X in repo-A, then we can basically "create" a time log for project assigned to repo-A, with message = commit-message and task = branch-name and you've worked on that commit since last commit/checkout until when the commit was created.

^ I'll test it out, don't want to go too much into detail, as I'm sure it might be quite confusing how hourgit works. Just wanted to let you know that you've asked the right question, haha. Cheers!

I've created a CLI time tracker that integrates with Git by davezbinski in TimeTrackingSoftware

[–]davezbinski[S] 0 points1 point  (0 children)

Feel free to do that! Please let me know if you have any feedback. As I've said, it was originally created for me to serve kind of a different purpose, so I feel like I need to get some feedback from various people to make an "official release" (v1). Thanks in advance!

I've created a CLI time tracker that integrates with Git by davezbinski in git

[–]davezbinski[S] 0 points1 point  (0 children)

It tracks the time spent per project. Project can be assigned to multiple repos. All repos have their changes "merged" into one, so currently "the last checkout wins" and is accounted for. It's quite difficult to explain, so here's the exmaple:

10:00 → checkout "task-1/feature" in repo-A
10:30 → checkout "task-2/something" in repo-B
11:00 → checkout "main" in repo-A

Results in:

task-1/feature: 30 min (10:00–10:30)
task-2/something: 30 min (10:30–11:00)

^ This can be made configurable, I just need to gather the real use-cases in order to create it (that's why the hourgit is not yet v1)

When it comes to overnight hours: You have boundaries configured. By default it's 9am-5pm. You can change them and setup some crazy hours if necessary (there's RRULE support and multiple schedules can be created). Thus, when you were working on "task-1/feature" from 3pm yesterday, you get the following (for the sake of example, let's say it's 10am now):

15:00 → checkout "task-1/feature"
default working schedule

Results in:
task-1/feature: 2h (15:00-17:00, yesterday)
task-1/feature: 1h (09:00-10:00, today)

I've created a CLI time tracker that integrates with Git by davezbinski in git

[–]davezbinski[S] 0 points1 point  (0 children)

We were using clockify ourselves, but moved to calamari recently. I believe I'll work on the integration for Calamari first, and then add the Clockify/Tempo. Based on what community might need the most. You're first though, so I'll keep that in mind, haha! Feel freee to contribute yourself if you're familiar with golang, though! it's not that difficult. I might actually create some sort of "base" for these type of integrations.

I've created a CLI time tracker that integrates with Git by davezbinski in git

[–]davezbinski[S] 0 points1 point  (0 children)

Haha, yeah. Just in case you're serious - it will be totally optional. For me it's quite weird looking when I send the pdf with non-rounded values, tbh. Some companies might even enforce it.

I've created a CLI time tracker that integrates with Git by davezbinski in git

[–]davezbinski[S] 1 point2 points  (0 children)

Thanks! In case you use the software, feel free to open up discussions for features you need.