You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ignore files with a UTF-8 BOM: first pattern silently dropped (git honors it, graphify does not) #2163
.gitignore and .graphifyignore are parsed without stripping a leading UTF-8 BOM. When the file is BOM-encoded, the first pattern is silently dropped — it is read as <BOM><pattern>, which matches nothing.
Git itself strips the BOM, so a file git honors is silently ignored by graphify. There is no warning.
This is easy to hit on Windows: PowerShell 5.1's Set-Content -Encoding utf8 — the most obvious way to write the file — emits a BOM.
Reproduce
Fixture: a repo with keep/a.py plus five .py files under .fable-wt/wt1/.
# BOM-free
[System.IO.File]::WriteAllText("$t\.graphifyignore",".fable-wt/`n", (New-Object System.Text.UTF8Encoding($false)))
graphify .--code-only # -> found 1 code CORRECT# identical content, with BOM
[System.IO.File]::WriteAllText("$t\.graphifyignore",".fable-wt/`n", (New-Object System.Text.UTF8Encoding($true)))
graphify .--code-only # -> found 6 code PATTERN SILENTLY IGNORED# what a Windows user actually typesSet-Content-Path "$t\.graphifyignore"-Value ".fable-wt/"-Encoding utf8
graphify .--code-only # -> found 6 code PATTERN SILENTLY IGNORED
graphify documents that it honors .gitignore, but diverges from git on BOM-encoded files.
Impact
Silent. On a monorepo where the intended exclusion is a worktree root, dropping that one pattern is the difference between indexing one copy of the tree and indexing 100+. In my case the first pattern was .fable-wt/ against 111 worktrees; the run went from seconds to 27+ minutes of CPU with no indication the ignore file was not in effect.
Possibly related: #1958 (detect() CPU-bound 35+ min on large monorepo).
Suggested fix
Read ignore files with utf-8-sig, which transparently handles both BOM and BOM-free input. In detect.py, in the per-directory reader and _load_graphifyignore:
text=path.read_text(encoding="utf-8-sig")
Optionally also warn when an ignore file is BOM-encoded, since the failure is otherwise invisible.
Fixed in v0.9.26. .gitignore/.graphifyignore/info/exclude are now read with utf-8-sig, so a leading UTF-8 BOM is stripped (matching git) and the first pattern is honored instead of silently dropped. https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.26
Activity
fix(detect): honor ignore files saved with a UTF-8 BOM (#2163)
chore: bump to 0.9.26; changelog for #2137/#2126/#2148/#2141/#2079/#2163
safishamsi commentedon Jul 24, 2026
Fixed in v0.9.26.
.gitignore/.graphifyignore/info/excludeare now read withutf-8-sig, so a leading UTF-8 BOM is stripped (matching git) and the first pattern is honored instead of silently dropped. https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.26fix(install): never clobber an unparseable settings file; back up bef…
Squashed commit of the following:
fix(detect): honor ignore files saved with a UTF-8 BOM (Graphify-Labs…
chore: bump to 0.9.26; changelog for Graphify-Labs#2137/Graphify-Labs…
fix(install): never clobber an unparseable settings file; back up bef…