Tracking git branch checked out? #1154
Replies: 4 comments
|
I'm going to add here that another thing incredibly useful would be to tie Copilot conversations to the logs somehow. Logs in (Again, exactly how this would happen -- is a different Watcher watching it, or is it part of some existing Watcher, that's what I could use advice on.) |
|
https://superuser.com/questions/105499/change-terminal-title-in-mac-os-x Combining these two questions should allow you to display your current Git branch in the Terminal title, which will then be recorded by ActivityWatch :) |
|
You could create your own watcher that is somehow configured which folders to watch and reports which branches are current there. Shouldn't be much work. A bit harder would be making the finding which folders to watch automatic. An easier avenue might be extending the VScode watcher. There's link to it from docs about other watchers. |
|
Hey Elliot, Most of what you want already fits ActivityWatch’s architectureThe key distinction is that ActivityWatch does not need to save a complete snapshot every minute. Watchers send heartbeats when context changes, and ActivityWatch stores the resulting time intervals. That produces a much smaller timeline that can still be expanded into minute-level reporting later. Git branch tracking in VS CodeThe official
This belongs in the editor watcher, not in Parsing directories from window titles would be fragile because:
The VS Code extension can use VS Code’s integrated Git API, which gives it a much more reliable understanding of the active repository. There has been an issue where the Marketplace version did not include the branch functionality even though it had already been merged into the repository. I would check the raw VS Code watcher events in ActivityWatch’s Timeline and confirm whether they contain a Relevant links:
Terminal activity is a different problemFor terminal work, I would use a separate terminal or shell watcher. A shell integration could emit an event whenever a prompt or command starts, containing metadata such as:
That is more reliable than trying to infer the working directory from the terminal window title. I would make command capture optional. Commands frequently contain tokens, passwords, internal URLs, customer names, and other sensitive information. Repository and branch metadata are usually enough for a daily activity report. Copilot conversations should probably be a separate importerIf the source is persisted JSON under VS Code’s The importer could:
I would avoid storing complete prompts and responses by default. Copilot conversations can contain source code, credentials, proprietary information, and copied production data. A safer event might contain:
Reading Where correlation should happenI would keep the architecture separated:
For example, a report generator could combine:
That derived timeline could then be sent to a local model to generate a summary without changing the original events. Suggested component ownership
This keeps each watcher small and prevents the generic window watcher from becoming responsible for understanding Git, terminals, editors, and AI tools. So yes, the project’s architecture is a good fit for this. Git branch support already exists for VS Code; the most valuable contributions would likely be reliable terminal context collection and a privacy-conscious importer/reporting pipeline for AI conversations. |
Uh oh!
There was an error while loading. Please reload this page.
I just found this project today and have been playing with it, and it might be perfect for me.
The one thing I find missing is: my eventual goal is to be able to take collapsed log files for a day and produce a report (possibly fed through local AI) that can give me a summary of the way I spent my day... without any kind of intentional clocking in-out (no pomodoro stuff).
I think for this I need more than just window titles. "Terminal" and "VSCode" do happen to have their folder opened in the title (and in the case of VSCode, the file as well), which is a good start: but I really need what git branch is checked out in that folder as well.
What I'm hoping is: raw logs minute-by-minute throughout the day, recording window titles, but also if a window title seems to have a folder in it, and that folder contains a .git folder, what branch was checked out during that minute.
Does such a feature exist, or if not, what component should it live in? (I'm potentially interested in contributing it if it would fit into the architecture and the project is still alive.)
All reactions