Skip to content

[Fix] Stop gitignore from silently ignoring new __init__.py files - #5980

Merged
hujc7 merged 1 commit into
isaac-sim:developfrom
hujc7:jichuanh/gitignore-init-py
Jun 5, 2026
Merged

hujc7 merged 1 commit into
isaac-sim:developfrom
hujc7:jichuanh/gitignore-init-py

Conversation

@hujc7

@hujc7 hujc7 commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Removes the **/__* 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__.pyi files.
  • Any Python package added after Fixes M1 3.0 GA Issues #5343 had its init files dropped from git add, causing import failures on a clean checkout that are hard to trace back to .gitignore. On the current develop working tree this already hides 199 untracked __init__.py / __init__.pyi files under newly added isaaclab_tasks subpackages.
  • No loss of coverage: the pattern's only concrete target, __pycache__/, is already handled by the pre-existing **/__pycache__/ rule (line 20).

1. Problem

The # Dev-time files, generated stuff block added **/__* as a catch-all. Git applies .gitignore to untracked files, so while already-tracked init files are unaffected, every new package's __init__.py is silently ignored:

$ git check-ignore -v source/isaaclab_tasks/isaaclab_tasks/core/__init__.py
.gitignore:84:**/__*	source/isaaclab_tasks/isaaclab_tasks/core/__init__.py

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.

 # Ruff cache
 **/.ruff_cache/
 
-# Dev-time files, generated stuff
-**/__*
-
 # Isaac Lab CI environments in native mode
 **/_isaaclab_install_ci_*

3. Verification

# new package init files are tracked again:
$ git check-ignore -v source/isaaclab_tasks/isaaclab_tasks/core/__init__.py
(no output — not ignored)

# __pycache__ is still ignored via the existing rule:
$ git check-ignore -v foo/__pycache__/bar.pyc
.gitignore:20:**/__pycache__/	foo/__pycache__/bar.pyc

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/).

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.

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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-apps

greptile-apps Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR removes the **/__* glob from .gitignore, which was silently preventing any new file or directory whose name starts with __ from being tracked by git. Because __pycache__/ is already handled by the separate **/__pycache__/ rule on line 20, no coverage is lost.

  • Root cause: PR Fixes M1 3.0 GA Issues #5343 added **/__* as a broad catch-all; git applies .gitignore only to untracked paths, so already-committed __init__.py files were safe but every newly added package's init file was silently dropped from staging, causing "module not found" errors on clean checkouts with no obvious link to .gitignore.
  • Impact of the fix: 199 untracked __init__.py / __init__.pyi files under isaaclab_tasks subpackages will now be staged normally; no other intentionally ignored artifacts are affected.

Confidence Score: 5/5

Safe to merge — a single, well-scoped line removal from .gitignore with no functional code changes.

The deleted **/__* rule was the only thing preventing new __init__.py and similar dunder-named files from being staged. The sole legitimate target of that rule (__pycache__/) is independently covered by **/__pycache__/ on line 20. After this change every new Python package's init files will be tracked correctly, and no previously ignored artifact category loses its rule.

No files require special attention — the only changed file is .gitignore and the removal is straightforward.

Important Files Changed

Filename Overview
.gitignore Removes the overly broad **/__* pattern that silently dropped all new __init__.py / __init__.pyi files from git tracking; __pycache__/ coverage is preserved by the pre-existing **/__pycache__/ rule.

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
Loading

Reviews (1): Last reviewed commit: "Remove overly broad `**/__*` gitignore p..." | Re-trigger Greptile

@hujc7
hujc7 merged commit 92a1e0b into isaac-sim:develop Jun 5, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants