topdir.mk: Derive GITIGNORE_PATTERNS_END from TOP #136
Loading…
Reference in a new issue
No description provided.
Delete branch "jan/feature/20261003-topdir-mk-derive-gitignore-patterns-end-from-top"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
topdir.mk: Derive GITIGNORE_PATTERNS_END from TOP
The !-exceptions in the generated
.gitignoreare computed by a grep pattern that hardcodes the project name, while the top ignore line comes fromGITIGNORE_PATTERNS_TOP. A project that overridesGITIGNORE_PATTERNS_TOP-jw-pkg's Makefile sets it to empty - still gets the hardcoded exceptions, and patterns a project adds there get no exceptions at all, so the two can drift apart.Derive the exception pattern from the same variable:
GITIGNORE_PATTERNS_TOP_INVjoins the patterns ofGITIGNORE_PATTERNS_TOPwith |, each wrapped in word boundaries, plus the__init__.pypatternGITIGNORE_PATTERNS_ENDgreps the tracked files for that alternation with grep -E instead of a hardcoded BRE, so the dot in__init__.pyis literal instead of matching any characterWith the default
GITIGNORE_PATTERNS_TOPthe generated.gitignoreis byte-for-byte identical to before.