Skip to content

feat: git status tracking#6

Merged
hay-kot merged 8 commits into
mainfrom
feature/git-status-tracking
Dec 4, 2025
Merged

feat: git status tracking#6
hay-kot merged 8 commits into
mainfrom
feature/git-status-tracking

Conversation

@hay-kot

@hay-kot hay-kot commented Dec 4, 2025

Copy link
Copy Markdown
Collaborator

Fixes #4

Purpose

Adds support to see git information in the hive status

Add methods to support git status tracking in TUI:
- Branch: returns current branch name or commit SHA for detached HEAD
- DiffStats: returns line additions/deletions compared to HEAD
Test coverage for:
- parseDiffStats parsing various git shortstat output formats
- Branch method returning branch name or commit SHA
- DiffStats method delegating to parseDiffStats
Add GitConfig struct with StatusWorkers field (default: 3).
Includes validation to ensure workers >= 1 and automatic
default application for unset values.
Display git repository state for each session in the TUI:
- Current branch name (or commit SHA for detached HEAD)
- Change statistics (+N -N format)
- Uncommitted changes indicator (clean/dirty status)

Implementation:
- Add pkg/kv generic thread-safe key-value store
- Add git status types and worker pool in internal/tui/gitstatus.go
- Integrate into TUI model with async message handling
- Update delegate to render git status on 4th line
- Add styles for clean (green), dirty (yellow), loading (gray)
- Add 'g' keybinding to refresh git status
- Expose Git() method on hive.Service for TUI access

Closes #4
Change DiffStats to compare current branch against the repository's
default branch (main/master) instead of HEAD. This shows total changes
for the entire branch rather than just uncommitted changes.

- Add DefaultBranch method to detect origin's default branch
- Update DiffStats to use main...HEAD comparison
- Fallback to HEAD comparison if default branch detection fails
@hay-kot hay-kot merged commit 614b4ec into main Dec 4, 2025
2 checks passed
@hay-kot hay-kot deleted the feature/git-status-tracking branch June 3, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add background git status tracking for sessions

1 participant