Skip to content

Add hierarchical .gito/config.toml support#257

Open
praphulmc-tt wants to merge 1 commit into
Nayjest:mainfrom
praphulmc-tt:hierarchical-config
Open

Add hierarchical .gito/config.toml support#257
praphulmc-tt wants to merge 1 commit into
Nayjest:mainfrom
praphulmc-tt:hierarchical-config

Conversation

@praphulmc-tt

@praphulmc-tt praphulmc-tt commented May 13, 2026

Copy link
Copy Markdown

Summary

Adds hierarchical .gito/config.toml support: every <subdir>/.gito/config.toml
under the repo root is discovered and merged with bundled defaults + the root
project config.

Merge rules (each level contributes only the keys it explicitly wrote):

  • Lists (aux_files, exclude_files, mention_triggers) — accumulate across
    all levels, deduped.
  • prompt_vars — union of keys; root wins on key conflict.
  • pipeline_steps — union of step names; root wins on name conflict.
    Per-step field-level merge is preserved (root setting enabled=false still
    inherits call from defaults).
  • Scalars (prompt, retries, max_code_tokens, …) — root supersedes;
    sub-directory configs only fill values the root left unset.

Pipeline step scoping: steps defined inside a sub-directory carry a scope
field equal to that directory; Pipeline.run filters ctx.diff to files under
the scope and skips the step entirely when no diff files match. Steps defined
in the root config keep scope="" and remain repo-wide.

Back-compat: the existing single-file ProjectConfig.load(config_path=...)
API is unchanged; if no repo_root is passed, discovery is skipped and
behavior matches main.

Test plan

  • 5 new tests in tests/test_project_config.py: cumulative lists, root-wins
    scalars, root-wins prompt_vars, pipeline step scope + per-field inheritance,
    ignored-dir pruning.
  • 3 new tests in tests/test_pipeline.py: matches_path boundaries, scoped
    diff filtering, scoped-step skip when no matching files.
  • All existing tests still pass: pytest tests/test_project_config.py tests/test_pipeline.py → 18
    passed locally.
  • Ran gito review --against main against this branch locally — no issues found.

Discover every `<subdir>/.gito/config.toml` under the repo root and merge
them with bundled defaults and the root project config so that:

- Lists (aux_files, exclude_files, mention_triggers) accumulate across
  all levels (deduped).
- prompt_vars and pipeline_steps are unioned; the root config wins on
  any key/name conflict, while sub-directory configs fill in values the
  root did not explicitly set.
- Pipeline steps defined in a sub-directory carry a `scope` field and
  only run against diff entries under that directory; if no diff file
  matches, the step is skipped.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant