Skip to content
Novus Examples
gitignore197 B

Gitignore - The Working Form of the Same Negation

The corrected twin: `build/*` excludes the directory's contents instead of the directory, so git still descends and `!build/keep.txt` re-includes the file. The two fixtures differ by two characters and produce opposite results, which makes them a precise pass/fail pair for an ignore engine.

Preview — first 8 linesgitignore
# The fix: exclude the CONTENTS of the directory, not the directory itself,
# so git still descends and the re-inclusion below can match.
build/*
!build/keep.txt

coverage/*
!coverage/summary.json

Specifications

Seed
20260807
Repository Name
.gitignore
Patterns
4
Negations
2
Negations That Take Effect
2
Line Endings
LF
Encoding
UTF-8

Testing contract

Expected to pass
Scenario
Run the same four queries against this twin as against the trap fixture.
Expected result
build/keep.txt and coverage/summary.json are NOT ignored, while build/bundle.js and coverage/lcov.info still are.

What is a .gitignore file?

A .gitignore file tells Git which untracked paths to leave alone. Each line is a pattern: a leading `/` anchors it to the containing directory, a trailing `/` restricts it to directories, `!` re-includes a previously excluded path, `**` matches across directory boundaries, and `#` introduces a comment. Rules are evaluated in order, with the last matching pattern winning, and nested .gitignore files layer on top of parent ones.

How to use this file

Use an example .gitignore file to test ignore-pattern engines in build tools, bundlers, linters, and container builders, checking negation ordering, anchored versus floating patterns, and directory-only rules against a documented set of expected matches.

How to use this file for testing

“Gitignore - The Working Form of the Same Negation” is a deterministic Novus Examples fixture for Config parsing, Config testing, Visual diff / regression. TOML and INI configuration files with nested sections and typed values — for testing config parsers and loaders.

Documented properties for this file: seed 20260807 · UTF-8 · LF. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Diff and patch fixtures name their target paths and the exact edge case they exercise — rename, mode change, binary hunk, CRLF↔LF, or missing trailing newline. Apply or render them against the documented before-state; every author, path, and hash is fictional.

Point your config loader at the file and assert it reads the documented sections and typed values, including any deliberately-tricky nesting or comments.

Generated by generation/version_control.py. Free for any use, no attribution required — license.