Skip to main content

Module gitignore

Module gitignore 

Source
Expand description

Gitignore management for Ralph initialization.

Responsibilities:

  • Ensure .ralph/workspaces/ is in .gitignore to prevent dirty repo issues.
  • Ensure .ralph/logs/ is in .gitignore to prevent committing unredacted debug logs.
  • Provide idempotent updates to .gitignore.

Not handled here:

  • Reading or parsing existing .gitignore patterns (only simple line-based checks).
  • Global gitignore configuration (only repo-local .gitignore).

Invariants/assumptions:

  • Updates are additive only (never removes entries).
  • Safe to run multiple times (idempotent).

Functionsยง

ensure_ralph_gitignore_entries
Ensures Ralph-specific entries exist in .gitignore.
migrate_json_to_jsonc_gitignore
Migrate .json ignore patterns to .jsonc in .gitignore.