GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Preserve implicit boolean config keys by Byron · Pull Request #2238 · gitpython-developers/GitPython

Conversation

@Byron

@Byron Byron commented Sep 13, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Tasks

This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here.

  • refackiew

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).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Byron @codex
fix: preserve implicit boolean config keys (#2237)
2229668
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 <[email protected]>
@Byron
Byron force-pushed the read-implicit-bool branch from 0b6c168 to 2229668 Compare September 13, 2026 15:16
@Byron
Byron marked this pull request as ready for review September 13, 2026 15:42
Copilot AI lite review requested due to automatic review settings September 13, 2026 15:42
@Byron
Byron merged commit d171e34 into main Sep 13, 2026
54 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Copilot started reviewing on behalf of Byron September 13, 2026 15:42
View session
Copilot AI reviewed Sep 13, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

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 overview

Preserves Git-style valueless configuration keys through parsing, access, and write-back.

Changes:

  • Stores valueless options as None.
  • Preserves repeated entries and bare syntax during serialization.
  • Adds regression coverage for boolean semantics and round-tripping.
File summaries
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.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread git/config.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Byron
Byron deleted the read-implicit-bool branch September 13, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

A config key written without a value is dropped, where git reads it as true

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Byron
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.