| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
The lint job on PR #2241 failed in the codespell pre-commit hook because the new write-preservation regression used "readded" as a sample value. The same two diagnostics reproduce with codespell 2.4.3 locally. Use "again" in both the assignment and assertion. The value is arbitrary: the regression checks the spelling of a removed and recreated option, so this satisfies lint without changing the behavior under test. Validation: codespell passes for the three PR files; the affected test passes on Python 3.14.7; Ruff lint and formatting pass for test_config.py.
Mostly a rubber-stamp, impl seems sane and tests seem to cover the important bits. <!-- agent --> GitConfigParser required exact section and option spelling, so valid Git configuration such as core.BigName could not be read as CORE.bigname. Differently cased sections and options also stayed separate, causing lookups to miss later values and writers to create duplicate settings. Index the ordered multi-dictionary by normalized names while retaining the first spelling in storage. Lowercase the section/option portion only; quoted subsection names remain case-sensitive. The shared mapping covers the inherited ConfigParser accessors, multivalue reads, and mutations without scanning all stored names. Case variants now merge in read order, and enumeration and write-back use the first spelling for each name. Normalize include section matching and remote discovery as well, while keeping include conditions and remote names case-sensitive. Add regressions for case variants, duplicate values, implicit booleans, quoted subsections, spelling-preserving writes, removal and renaming, included files, and remote discovery. The three new regression tests failed before the fix. Extend the existing setlast check to cover mixed case and clearing the name index. The behavior follows Documentation/config.adoc and the mixed-case and subsection tests in t/t1300-config.sh from the local Git reference at 1630431f326e15fcde608827b5ff38422528eb59. Regression comparisons with git config --get and --get-all used Git 2.50.1 (Apple Git-155). Assisted-by: GPT 6.0 Co-authored-by: GPT 6.0 <codex@openai.com>
There was a problem hiding this comment.
Unresolved moderate and critical issues remain in git/config.py.
Get a fresh assessment by requesting another Copilot review.
Pull request overviewThis pull request makes Git configuration section and option matching case-insensitive while preserving quoted subsection case sensitivity.
Changes:
| File | Summary |
|---|---|
| test/test_config.py | Adds regression coverage. |
| git/remote.py | Supports mixed-case remote sections. |
| git/config.py | Implements normalized config-name matching. |
git/config.py:217
def __init__(self, *args: Any, **kwargs: Any) -> None:
self._keymap: Dict[str, str] = {}
super().__init__(*args, **kwargs)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
| def _key(self, key: str) -> str: | ||
| stored = self._keymap.get(_normalize_name(key), key) | ||
| return stored if super().__contains__(stored) else key |
| Back | FazBrowse Home | New Git URL |
Tasks
This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here.
Everything below this line was generated by Codex GPT-6.
Created by Codex on behalf of Byron. Byron will review before this is ready to merge.
Fixes #2240.
GitConfigParser now matches section and option names without regard to case, so get_value("CORE", "bigname") can read [core] BigName = 1. Quoted subsection names remain case-sensitive: remote "Origin" and remote "origin" are distinct.
The existing ordered multi-dictionary indexes normalized names while retaining the first spelling for enumeration and write-back. Case variants merge into one setting with values in read order, and reads, additions, updates, removals, and renames share the same matching rules. Include sections and remote discovery also accept mixed-case section names.
Regression coverage checks duplicate values, implicit booleans, subsection case, original spelling, mutations, included files, and remote discovery. The three new regression tests failed before the fix.
Validation:
Git behavior was checked against Git 2.50.1 and the local Git reference at 1630431f326e15fcde608827b5ff38422528eb59, particularly Documentation/config.adoc and the mixed-case/subsection tests in t/t1300-config.sh.
Commits: 94a591d4 (config matching) and c4beffeb (test value spelling).
Each commit received one codex review --commit attempt. Both attempts failed because the CLI login has expired (HTTP 401), so no Codex review result is available.