Skip to content

refactor: one walk over root, not two #15

Open

Description

@simonostendorf

Goal

One walk over root, used by every command that needs the repositories under it.

Context

discoverRepos returns a path list. scan.Walk returns Result values carrying the richer
profile.Repo, and since #3's rework it also asks git for each repository's own linked
worktrees, which discoverRepos does not. So the two already disagree: path, open, status
and sync cannot see a worktree that list and cd can.

Acceptance criteria

  • internal/scan is the only walk over root in the repository.
  • cmd/gitcd/discover.go is gone, and path, open, status and sync use
    internal/scan.
  • A linked worktree nested at <repo>/.claude/worktrees/<branch> is reachable from every
    command that takes a repository query, not only from list and cd.
  • Whether each command includes linked worktrees by default is stated once and tested, rather
    than decided separately per command as it is today.
  • A nested independent repository is still never reported, with the existing test kept.
  • AGENTS.md no longer carries the reconciliation note.
  • task check passes.

Out of scope

  • Changing the boundary rule itself, or how profile.Inspect resolves a repository.
  • Any new command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    improvementImprovement to an existing featurestack: goRelated to Go code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions