The sabhiram/go-gitignore dependency is unmaintained (since 2021) and has
known gitignore spec gaps (* traverses /, ? broken, weak ** handling).
Vendor the pattern/matcher core of go-git (plumbing/format/gitignore,
v5.19.1) into internal/gitignore instead. It is ~185 lines of pure-stdlib,
spec-correct code (proper **, anchoring, dir-only and negation handling).
The file-walking helpers (dir.go) are intentionally omitted as they pull in
go-billy and other go-git internals; importing the upstream package directly
would re-add that transitive weight, which is why go-git was dropped before.
This gains gitignore spec compliance while removing a direct dependency
rather than adding one. The vendored code keeps its Apache-2.0 license
(internal/gitignore/LICENSE) with attribution headers; upstream test cases
are ported to table-driven stdlib tests to avoid an extra test dependency.
Rename the Taskfile/task option from `gitignore` to `use_gitignore`
to avoid ambiguity (could be read as "ignore git" vs "use .gitignore").
Consistent with Biome's `useIgnoreFile` naming convention.
Walk up from task dir to find .git instead of threading rootDir through
Globs, checkers, and itemsFromFor. Gitignore rules are discarded if no
.git is found, matching ripgrep's require_git behavior. This keeps the
Globs signature clean and makes the future .taskignore integration
straightforward (loaded at setup like .taskrc, separate boundary).
go-git pulled ~30 transitive dependencies and recursively walked the
entire worktree on every Globs() call. Replace with sabhiram/go-gitignore
(zero dependencies) and a simple walk from task dir up to rootDir to
collect .gitignore files. Pass rootDir (Taskfile ROOT_DIR) through the
checker chain to bound the search scope.
When `gitignore: true` is set at the Taskfile or task level, files
matching .gitignore rules are automatically excluded from sources and
generates glob resolution. This prevents rebuilds triggered by changes
to files that are in .gitignore (build artifacts, generated files, etc.).
Uses go-git to load .gitignore patterns including nested .gitignore
files, .git/info/exclude, and global gitignore configuration.
This is part of the LLM plugin. It's distracting and not really useful.
We're keeping the markdown version of the pages, tho. Just append `.md`
to any page to see the markdown version.