Skip to content

Commit c97ba61

Browse files
runonthespotclaude
andcommitted
fix: prevent hidden directories from being indexed
- Changed .hidden(false) to .hidden(true) in WalkBuilder configuration - Fixes critical bug where .git and other hidden directories were indexed - Eliminates .git files appearing in semantic search results - Reduces index size and improves performance The bug was causing: - .git directory contents to be indexed as .ck/.git/... - Semantic search finding git refs for unrelated queries - Unnecessary storage and processing of hidden files 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 51bcde5 commit c97ba61

12 files changed

Lines changed: 62 additions & 31 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.4.2] - 2025-09-11
6+
7+
### Fixed
8+
- **Hidden file indexing bug**: Fixed critical bug where hidden directories (especially `.git`) were being indexed despite exclusion patterns
9+
- **Semantic search pollution**: Eliminated `.git` files appearing in semantic search results for unrelated queries
10+
- **Index size reduction**: Significantly reduced index size by properly excluding hidden files and directories
11+
12+
### Technical
13+
- **WalkBuilder configuration**: Changed `.hidden(false)` to `.hidden(true)` to respect hidden file conventions
14+
- **Exclusion pattern enforcement**: Hidden file exclusion now takes precedence, preventing override patterns from being ignored
15+
- **Performance improvement**: Reduced indexing time and storage by not processing `.git` and other hidden directories
16+
517
## [0.4.1] - 2025-09-10
618

719
### Added

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ members = [
1212
]
1313

1414
[workspace.package]
15-
version = "0.4.1"
15+
version = "0.4.2"
1616
edition = "2024"
1717
authors = ["Mike Renwick"]
1818
license = "MIT OR Apache-2.0"

ck-ann/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ keywords = ["search", "ann", "vector"]
1111
categories = ["algorithms"]
1212

1313
[dependencies]
14-
ck-core = { version = "0.4.1", path = "../ck-core" }
14+
ck-core = { version = "0.4.2", path = "../ck-core" }
1515

1616
anyhow = { workspace = true }
1717
serde = { workspace = true }

ck-chunk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ keywords = ["parsing", "chunking", "tree-sitter"]
1111
categories = ["parsing"]
1212

1313
[dependencies]
14-
ck-core = { version = "0.4.1", path = "../ck-core" }
14+
ck-core = { version = "0.4.2", path = "../ck-core" }
1515

1616
anyhow = { workspace = true }
1717
serde = { workspace = true }

ck-cli/Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ck-search"
3-
version = "0.4.1"
3+
version = "0.4.2"
44
edition = "2024"
55
authors = ["Mike Renwick"]
66
license = "MIT OR Apache-2.0"
@@ -17,13 +17,13 @@ name = "ck"
1717
path = "src/main.rs"
1818

1919
[dependencies]
20-
ck-core = { version = "0.4.1", path = "../ck-core" }
21-
ck-index = { version = "0.4.1", path = "../ck-index" }
22-
ck-engine = { version = "0.4.1", path = "../ck-engine" }
23-
ck-chunk = { version = "0.4.1", path = "../ck-chunk" }
24-
ck-embed = { version = "0.4.1", path = "../ck-embed" }
25-
ck-ann = { version = "0.4.1", path = "../ck-ann" }
26-
ck-models = { version = "0.4.1", path = "../ck-models" }
20+
ck-core = { version = "0.4.2", path = "../ck-core" }
21+
ck-index = { version = "0.4.2", path = "../ck-index" }
22+
ck-engine = { version = "0.4.2", path = "../ck-engine" }
23+
ck-chunk = { version = "0.4.2", path = "../ck-chunk" }
24+
ck-embed = { version = "0.4.2", path = "../ck-embed" }
25+
ck-ann = { version = "0.4.2", path = "../ck-ann" }
26+
ck-models = { version = "0.4.2", path = "../ck-models" }
2727

2828
anyhow = { workspace = true }
2929
clap = { workspace = true }

ck-embed/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ keywords = ["embedding", "nlp", "semantic"]
1111
categories = ["science"]
1212

1313
[dependencies]
14-
ck-core = { version = "0.4.1", path = "../ck-core" }
14+
ck-core = { version = "0.4.2", path = "../ck-core" }
1515

1616
anyhow = { workspace = true }
1717
serde = { workspace = true }

ck-engine/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ keywords = ["search", "engine", "semantic"]
1111
categories = ["algorithms"]
1212

1313
[dependencies]
14-
ck-core = { version = "0.4.1", path = "../ck-core" }
15-
ck-index = { version = "0.4.1", path = "../ck-index" }
16-
ck-embed = { version = "0.4.1", path = "../ck-embed" }
17-
ck-ann = { version = "0.4.1", path = "../ck-ann" }
18-
ck-chunk = { version = "0.4.1", path = "../ck-chunk" }
14+
ck-core = { version = "0.4.2", path = "../ck-core" }
15+
ck-index = { version = "0.4.2", path = "../ck-index" }
16+
ck-embed = { version = "0.4.2", path = "../ck-embed" }
17+
ck-ann = { version = "0.4.2", path = "../ck-ann" }
18+
ck-chunk = { version = "0.4.2", path = "../ck-chunk" }
1919
serde_json = { workspace = true }
2020

2121
anyhow = { workspace = true }

ck-index/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ keywords = ["indexing", "search", "storage"]
1111
categories = ["database-implementations"]
1212

1313
[dependencies]
14-
ck-core = { version = "0.4.1", path = "../ck-core" }
15-
ck-chunk = { version = "0.4.1", path = "../ck-chunk" }
16-
ck-embed = { version = "0.4.1", path = "../ck-embed" }
14+
ck-core = { version = "0.4.2", path = "../ck-core" }
15+
ck-chunk = { version = "0.4.2", path = "../ck-chunk" }
16+
ck-embed = { version = "0.4.2", path = "../ck-embed" }
1717

1818
anyhow = { workspace = true }
1919
serde = { workspace = true }

ck-index/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub fn collect_files(
8888
.git_ignore(true)
8989
.git_global(true)
9090
.git_exclude(true)
91-
.hidden(false)
91+
.hidden(true)
9292
.overrides(overrides)
9393
.build()
9494
.filter_map(|entry| entry.ok())
@@ -112,7 +112,7 @@ pub fn collect_files(
112112

113113
Ok(WalkBuilder::new(path)
114114
.git_ignore(false)
115-
.hidden(false)
115+
.hidden(true)
116116
.overrides(combined_overrides)
117117
.build()
118118
.filter_map(|entry| entry.ok())

0 commit comments

Comments
 (0)