Skip to content

feat/5 pass git integration - #12

Merged
mandus merged 14 commits into
mainfrom
feat/5-pass-git-integration
Jun 12, 2026
Merged

mandus merged 14 commits into
mainfrom
feat/5-pass-git-integration

Conversation

@mandus

@mandus mandus commented Jun 12, 2026

Copy link
Copy Markdown
Owner
  • ✨ feat: add git integration to pass
  • 🔧 chore: improve git ahead/behind detection with git ls-remote and fetch --dry-run
  • 🐧 fix: make password store directory detection cross-platform
  • 🐛 fix: correct ahead/behind detection in git status
  • 🎨 refactor: simplify git status display to use < > = <> symbols
  • 🎨 refactor: remove commit counts from non-verbose git status output
  • 🎨 refactor: simplify TUI git status to show only symbols with colors
  • 📝 docs: update specifications and README for git integration
  • 🔄 fix: refresh password list in TUI after git push/update
  • 🐛 fix: handle git rev-list errors gracefully in sync status
  • 🐛 fix: ensure git fetch is called to update remote refs before sync check
  • 🔧 chmoded some scripts
  • 🙈 added pass in gitignore

Test User added 14 commits June 12, 2026 22:18
- Add pass git command with subcommands (status, push, update, init)
- Add git status checking functionality (ahead/behind, uncommitted changes)
- Add TUI integration with git status display and keyboard shortcuts
- Add comprehensive tests for git functionality
- Follow spec-driven development with full specification

Implements: feat/5-pass-git-integration
…tch --dry-run

- Use git ls-remote as primary method for remote hash detection
- Fallback to git fetch --dry-run to update remote refs
- Fallback to local remote refs as last resort
- Add merge conflict detection in TUI (! symbol)
- Update spec checklist and README with new features
- Improve documentation

Refines: feat/5-pass-git-integration
- Check USERPROFILE on Windows (existing)
- Check HOME on Linux/macOS (new)
- Fallback to .password-store if neither is set
- Updated both cmd/root.go and cmd/tui/fuzzy.go
- Matches the logic already present in pkg/config/config.go

Fixes: Cross-platform support for Linux/macOS users

Refines: feat/5-pass-git-integration
- Fixed countAheadBehind to correctly interpret git rev-list --left-right output
  - '<' = commits in local but not remote = ahead
  - '>' = commits in remote but not local = behind
  (Previously had these reversed)
- Strip refs/heads/ prefix from branch.merge config and upstream refs
- Now correctly shows behind state when remote has commits not in local

Fixes: pass git showing '=' when repo is actually behind remote

Refines: feat/5-pass-git-integration
- Changed from showing commit counts (⬆2, ⬇3) to simple symbols (<, >, =, <>)
- Matches standard git-prompt behavior
- Updated tests to match new format

Refines: feat/5-pass-git-integration
- Non-verbose 'pass git' now only shows simple symbols (>, <, =, <>)
- Commit counts only shown with -v/--verbose flag
- Matches user requirement to not show counts

Refines: feat/5-pass-git-integration
- TUI now shows only simple symbols (>, <, =, <>*) like CLI
- Added colored display using Bubble Tea/lipgloss:
  - Green for up to date
  - Yellow for ahead/behind/uncommitted
  - Red for merge conflicts
- Removed commit counts from TUI display

Refines: feat/5-pass-git-integration
- Updated README with final git commands and TUI status symbols
- Updated spec with correct symbols (<, >, =, <>)
- Updated implementation summary with final symbol list
- Marked documentation as complete in success criteria

Refines: feat/5-pass-git-integration
- Added refreshPasswordList() method to Model
- Password list now refreshes after successful git push/update operations
- Newly pulled passwords are immediately visible in TUI
- Updated spec with new acceptance criteria for password list refresh

Fixes: TUI not showing newly pulled passwords after git update

Refines: feat/5-pass-git-integration
- Non-fatal errors from git rev-list now return 0,0 instead of propagating error
- Prevents 'failed to count commits: exit status 128' from breaking TUI display
- Git status still shows remote info even if commit counting fails

Fixes: TUI showing error when remote is unreachable or has issues

Refines: feat/5-pass-git-integration
…heck

- getSyncStatus now uses git fetch (not dry-run) to update remote refs
- Then uses git rev-list --count --left-right with updated refs
- This ensures we're comparing with actual remote state, not stale local refs
- Added getUpstreamRef helper function

Fixes: TUI showing 'Up to date' when remote has actually been updated

Refines: feat/5-pass-git-integration
Fix tests failing with exit status 128 by properly configuring
git user.name and user.email in repository directories during
test setup. Also configure global git user in GitHub Actions
workflow as a fallback.

- Fix configureGitUser to check repo-local config
- Fix test setup functions to configure git in repo directory
- Add Configure Git step to CI workflow
@mandus
mandus merged commit 2df330b into main Jun 12, 2026
1 check passed
@mandus
mandus deleted the feat/5-pass-git-integration branch June 12, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant