Repository navigation
[Fix] Stop gitignore from silently ignoring new __init__.py files - #5980
Conversation
The `**/__*` pattern added in isaac-sim#5343 matches any untracked path component starting with double underscores at any depth. This silently ignores new `__init__.py` and `__init__.pyi` files, so freshly added Python packages drop out of `git add` and fail to import after a clean checkout. The pattern's only concrete target, `__pycache__/`, is already covered by the `**/__pycache__/` rule, so removing this line restores correct tracking of new package init files without losing any existing ignore coverage.
There was a problem hiding this comment.
🤖 Isaac Lab Review Bot
Summary
This PR removes the overly broad **/__* pattern from .gitignore (introduced in #5343). That glob matched any untracked path component starting with __ at any depth, which silently caused all new __init__.py / __init__.pyi files to be ignored by Git. The only concrete target of that rule (__pycache__/) is already handled by the pre-existing **/__pycache__/ rule on line 20, so removing it loses no ignore coverage while restoring correct tracking of new Python package init files.
Findings
No issues found.
- The change is a pure 3-line deletion (1 comment + 1 pattern + 1 blank line).
__pycache__/remains covered by the dedicated**/__pycache__/rule.- The PR body clearly documents the problem, fix, and verification steps.
- No risk of unintended side effects — no other
__-prefixed paths need ignoring that are not already covered by more specific rules.
Verdict
No issues found — clean, well-motivated fix. Good to merge.
Greptile SummaryThis PR removes the
Confidence Score: 5/5Safe to merge — a single, well-scoped line removal from The deleted No files require special attention — the only changed file is Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Developer runs git add] --> B{Is path untracked?}
B -- No --> C[Already tracked - always staged]
B -- Yes --> D{Match .gitignore rules?}
subgraph Before PR
D -- "__init__.py matched **/__*" --> E[Silently ignored]
D -- "__pycache__/ matched **/__pycache__/" --> F[Ignored as expected]
D -- "No match" --> G[Staged normally]
end
subgraph After PR
D2{Match .gitignore rules?}
D2 -- "__pycache__/ matched **/__pycache__/" --> F2[Ignored as expected]
D2 -- "No match" --> G2[Staged normally]
D2 -- "__init__.py no match" --> G2
end
D --> D2
Reviews (1): Last reviewed commit: "Remove overly broad `**/__*` gitignore p..." | Re-trigger Greptile |
Summary
**/__*rule from.gitignore(introduced in Fixes M1 3.0 GA Issues #5343), which matched every untracked path component starting with__at any depth — silently ignoring all new__init__.py/__init__.pyifiles.git add, causing import failures on a clean checkout that are hard to trace back to.gitignore. On the currentdevelopworking tree this already hides 199 untracked__init__.py/__init__.pyifiles under newly addedisaaclab_taskssubpackages.__pycache__/, is already handled by the pre-existing**/__pycache__/rule (line 20).1. Problem
The
# Dev-time files, generated stuffblock added**/__*as a catch-all. Git applies.gitignoreto untracked files, so while already-tracked init files are unaffected, every new package's__init__.pyis silently ignored:This produces "module not found" failures after a clean checkout that give no hint they originate from
.gitignore.2. Fix
Remove the
**/__*line and its comment. The block's only real target was__pycache__/, which**/__pycache__/already covers.3. Verification
Dev-infra/tooling change with no user-facing effect, so no changelog fragment is added (the changelog gate only requires fragments for managed packages touched under
source/).