Skip to content

fix(config): avoid config duplications#2345

Draft
becm wants to merge 2 commits into
git-ecosystem:mainfrom
becm:scope-includes
Draft

fix(config): avoid config duplications#2345
becm wants to merge 2 commits into
git-ecosystem:mainfrom
becm:scope-includes

Conversation

@becm
Copy link
Copy Markdown
Contributor

@becm becm commented May 14, 2026

Avoid duplication of entries already present in included files:

  • consistent include of files in Git config queries with scope limit
  • fix inconsistencies in setup state detection
  • avoid blind updates without checks, as Git will ignore existing entries in includes

Improves consistency regarding include behavior with cached Git config and

Fixes #2342
Fixes #1696
Fixes #1337

@becm becm requested a review from a team as a code owner May 14, 2026 16:51
@derrickstolee
Copy link
Copy Markdown
Contributor

@becm Thanks for identifying this key piece that connects to several issues. Could you add a test to demonstrate the behavior change to prevent regressions in the future?

@becm becm marked this pull request as draft May 14, 2026 18:11
@becm
Copy link
Copy Markdown
Contributor Author

becm commented May 14, 2026

@derrickstolee sadly only the 1st step, since:

  • the assignment seems to be unconditional
  • I did not even manage to get all instances where the --list request is issued.

add parameter to make file include behavior in config read consistent
retain existing parameters on write, always uses "primary" scope file
@becm becm force-pushed the scope-includes branch from 4949cdf to 7e80d8b Compare May 14, 2026 22:17
@becm becm changed the title fix(config): enable file include in scoped query fix(config): avoid config duplications May 14, 2026
find last guard entry and verify location is in front current executable
skip addition of guard entry if already present
@becm becm force-pushed the scope-includes branch from 7e80d8b to 5070c2b Compare May 14, 2026 22:40
@becm
Copy link
Copy Markdown
Contributor Author

becm commented May 16, 2026

@derrickstolee since the --include stuff is dependent on partnered Git version and file setup, I'd have no idea how to attempt a proper test (existing examples just operate on unrelated mock data).

Will try to implement a test for (abstract) config data with the (hopefully) resolved corner case of configure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants