feat: git status tracking#6
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4
Purpose
Adds support to see git information in the hive status