Skip to content

fix: anchor build-output gitignore rules to repo root - #7735

Merged
Vest merged 1 commit into
PCGen:masterfrom
Vest:fix/gitignore-anchor-build-dirs
Sep 10, 2026
Merged

Vest merged 1 commit into
PCGen:masterfrom
Vest:fix/gitignore-anchor-build-dirs

Conversation

@Vest

@Vest Vest commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Problem

The build-output block in .gitignore listed both anchored and unanchored forms of the same directories:

/output/
/build/
/libs/
output/     ← unanchored
build/      ← unanchored
libs/       ← unanchored

A pattern with no leading slash matches a directory of that name at any depth, so output/ also matched source packages like pcgen.output.*. Those files only remain tracked because gitignore does not evict already-tracked files — but any new file added to such a package (e.g. a test under code/src/test/pcgen/output/) is silently ignored and won't show up in git status.

Fix

Remove the three unanchored duplicates. The build writes its output to <root>/output (build.gradle: layout.projectDirectory.dir("output")) and to code/testsuite/output, both already covered by the anchored /output/ (and the explicit code/testsuite/output/) rules. So this ignores nothing the build needs, while unblocking new files in output/-named source packages.

Verified: after the change, no build artifact becomes newly tracked (git status clean), root output/, build/, libs/, and code/testsuite/output/ remain ignored, and code/src/test/pcgen/output/ is no longer ignored.

Lines 67-69 (`output/`, `build/`, `libs/`) duplicated the anchored
`/output/`, `/build/`, `/libs/` rules directly above them, but without a
leading slash they matched a directory of that name at ANY depth. That
silently ignored source packages such as pcgen.output.* (e.g. new files
under code/src/test/pcgen/output/), which only stay tracked because
gitignore does not evict already-tracked files.

The build writes its output to <root>/output (build.gradle: layout
.projectDirectory.dir("output")) and code/testsuite/output, both already
covered by the anchored /output/ and the explicit code/testsuite/output/
rules, so removing the unanchored trio ignores nothing the build needs
while unblocking new files in output/-named source packages.
@Vest Vest self-assigned this Sep 10, 2026
@Vest
Vest merged commit 8581882 into PCGen:master Sep 10, 2026
4 checks passed
@Vest
Vest deleted the fix/gitignore-anchor-build-dirs branch September 10, 2026 21:25
@github-actions

Copy link
Copy Markdown
Contributor

🚧 PCGen Code Coverage

Overall Project 26.06%

There is no coverage information present for the Files changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant