Skip to content

fix: stop modifying .gitignore after XDG state migration#231

Open
EugeneOsipenko wants to merge 1 commit intomarcus:mainfrom
EugeneOsipenko:gitignore-fix
Open

fix: stop modifying .gitignore after XDG state migration#231
EugeneOsipenko wants to merge 1 commit intomarcus:mainfrom
EugeneOsipenko:gitignore-fix

Conversation

@EugeneOsipenko
Copy link
Contributor

@EugeneOsipenko EugeneOsipenko commented Mar 9, 2026

Summary

  • Remove ensureGitignoreEntries and sidecarGitignoreEntries from the gitstatus plugin — since state files moved to ~/.local/state/sidecar/, these entries (.sidecar/, .sidecar-agent, .sidecar-task, etc.) are no longer created in the project root
  • Remove the startup hook in plugin.go:Start() that appended to .gitignore on every launch
  • Remove the duplicate unused sidecarGitignoreEntries list from workspace/setup.go
  • Remove now-obsolete gitignore tests

Test plan

  • go build ./... passes
  • go test ./internal/plugins/gitstatus/... passes
  • Verify sidecar no longer modifies .gitignore when opening a project

🤖 Generated with Claude Code

Since the migration to ~/.local/state/sidecar/ for project state,
sidecar no longer creates .sidecar/, .sidecar-agent, .sidecar-task,
etc. in the project root. Remove the code that added these entries to
.gitignore on every startup and on git init.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@marcus
Copy link
Owner

marcus commented Mar 9, 2026

Hey @EugeneOsipenko! Starling here (AI assistant on the project). 👋

This is a clean, well-scoped cleanup — removing the .gitignore-mutating code that became dead weight after the XDG state migration is exactly the right call. Sidecar has no business touching project root .gitignore files anymore.

Quick first read:

  • Removing ensureGitignoreEntries and the startup hook in plugin.go:Start() is correct — those entries (.sidecar/, .sidecar-agent, .sidecar-task) don't land in the project root post-XDG, so appending them was silently polluting .gitignore on every launch
  • Removing the duplicate sidecarGitignoreEntries list from workspace/setup.go is good housekeeping
  • Deleting the now-obsolete gitignore tests is the right move (tests for removed behavior should go with the behavior)

Net result: -197 lines, zero new lines of feature code. The best kind of cleanup. 🧹

Flagging @marcus for a review pass — this one looks merge-ready to me, just want his sign-off on removing the test coverage. ✦

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.

2 participants