| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
This was mostly a rubber-stamp, knowing the the whole implementation is quite a hack that is held together with ductape. Ideally, it will just work well enough at some point, to gain time for v4 to be made. <!-- agent --> GitConfigParser discarded keys written without an assignment. Reading such an option raised NoOptionError, and editing an unrelated setting silently removed it. Git treats a bare key as true but an explicitly empty value as false, so representing both as an empty string would lose their meaning. Store bare entries as None, following RawConfigParser's allow_no_value representation. Raw get/items access preserves the distinction, while get_value/get_values return an empty string as requested. Convert None to true and an empty string to false in getboolean, retaining the standard boolean spellings. Write None entries without an equals sign and exclude them from string validation and include-path expansion. The existing ordered multi-dict preserves repeated bare and assigned entries together. Update the regression that expected bare color.ui to disappear, and add a Git-backed read-modify-write test covering trailing whitespace, EOF without a newline, quoted and unquoted empty values, repeated keys, and a valueless non-path option in an include section. Both regressions failed before the fix. Compare Git's NUL-delimited listing before and after an unrelated edit and check the resulting repeated values with --type=bool --get-all. Git reference: checkout 1630431f326e15fcde608827b5ff38422528eb59, t/t1300-config.sh tests for novalue.variable and emptyvalue.variable, and parse.c:git_parse_maybe_bool_text. Runtime comparison 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.
Valueless keys followed by inline comments are parsed incorrectly and need to be fixed.
Get a fresh assessment by requesting another Copilot review.
Pull request overviewPreserves Git-style valueless configuration keys through parsing, access, and write-back.
Changes:
| File | Summary |
|---|---|
| test/test_config.py | Adds coverage for implicit booleans, empty values, duplicates, includes, and round-tripping. |
| git/config.py | Implements valueless-option handling and serialization; inline comments on bare keys still require correction. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
| 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.
Created by Codex on behalf of Byron. Byron will review before this is ready to merge.
Fixes #2237.
Bare config keys were dropped during parsing and disappeared when an unrelated setting was written. Preserve them as None, following RawConfigParser's valueless-option representation. get_value() and get_values() expose an empty string, while getboolean() returns True; explicitly empty assignments return False through getboolean(). Write-back retains bare syntax and repeated occurrences.
The regression covers bare keys, trailing whitespace, a final line without a newline, quoted and unquoted empty values, repeated values, and a valueless non-path option in an include section. It compares Git's NUL-delimited listing before and after an unrelated edit and verifies the resulting boolean values.
Validation on Python 3.12.14: 41 configuration tests passed, 2 existing skips; Ruff lint and formatting, mypy (46 source files), basedpyright, and git diff --check passed. Both regressions failed before the fix.
Codex review of 0b6c1682 found no actionable regressions.
Git reference: 1630431f326e15fcde608827b5ff38422528eb59, t/t1300-config.sh tests for valueless versus empty values, and parse.c:git_parse_maybe_bool_text. Runtime comparisons used Git 2.50.1 (Apple Git-155).