Skip to content

feat: warn when the store has no commits or uncommitted edits - #27

Draft
machado144 wants to merge 1 commit into
mainfrom
feat/store-git-warning
Draft

machado144 wants to merge 1 commit into
mainfrom
feat/store-git-warning

Conversation

@machado144

Copy link
Copy Markdown
Contributor

A small change with no spec, since it only adds a warning; say so if you want one written up.

What

loadout init runs git init on the store but never commits, so a store can live for months as "main has no commits yet". Store edits then have no history and no rollback, and nothing says so. Now status, sync and doctor print one hint line:

  ~ store has no commits — edits to it have no history or rollback. Commit it: git -C ~/.local/share/loadout/store add -A && git -C ~/.local/share/loadout/store commit -m "loadout store"
  ~ store has 1 uncommitted change(s) — commit them to keep history: git -C ~/.local/share/loadout/store status

The hint is silent when git isn't installed, when the store isn't a git repo (doctor notes that case), and when everything is committed. The hint is printed only; loadout does not commit for you.

Tests

  • internal/store/git_test.go: a fresh store reports no commits, then clean after commit, then 2 uncommitted after edits; a non-repo store gets no warning.
  • integration/store_git_test.go (real binary): status, sync --dry-run and doctor warn before the first commit, are silent after it, and sync reports a later uncommitted edit.
  • go test -race ./..., -tags integration, golangci-lint (0 issues).

🤖 Generated with Claude Code

* status, sync and doctor print a one-line git hint for the store
* silent when git is missing or the store is not a git repo

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

✅ PR title follows the required format

Current title: feat: warn when the store has no commits or uncommitted edits

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