Skip to content

fix: honor .git/info/exclude at the search root - #330

Merged
Pringled merged 1 commit into
MinishLab:mainfrom
nitayk:fix/honor-git-info-exclude
Nov 27, 2026
Merged

Pringled merged 1 commit into
MinishLab:mainfrom
nitayk:fix/honor-git-info-exclude

Conversation

@nitayk

@nitayk nitayk commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Closes #329.

semble reads .gitignore and .sembleignore but not .git/info/exclude, which git also honors. Tools such as Claude Code list nested worktrees (.claude/worktrees/) only in info/exclude, so searching a repo's main checkout returned duplicate hits from every worktree copy: in one real repo, 5 of the top 8 results.

This change reads info/exclude for the search root and applies it before the root .gitignore, the same order git uses. In a worktree, .git is a file, so it follows gitdir: and commondir to the shared git folder. It does not call the git binary. A search started inside a worktree still returns that worktree's files.

Tests cover a normal repo, a worktree .git file and no .git; they fail without the change. make lint, make typecheck and make test pass (401 tests, coverage 100%).

🤖 Generated with Claude Code

The walker read only .gitignore and .sembleignore, so paths excluded via
.git/info/exclude (for example nested worktrees under .claude/worktrees/)
were indexed and returned as duplicate hits. Read the root repo's
info/exclude, following a worktree's .git file to the common git dir.

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

codecov Bot commented Nov 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/semble/index/file_walker.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@greptile-apps

greptile-apps Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Reviews (1) · Last reviewed commit: "fix: honor .git/info/exclude at the sear..." · Reviewed by Greptile

@Pringled

Copy link
Copy Markdown
Member

@nitayk thanks for the contribution, LGTM!

@Pringled
Pringled merged commit aaeb5f6 into MinishLab:main Nov 27, 2026
17 checks passed
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.

Files listed in .git/info/exclude are indexed (nested worktree copies show up as duplicates)

2 participants