Title: Reject comments after implicit boolean config keys by Byron · Pull Request #2239 · gitpython-developers/GitPython · GitHub
Open Graph Title: Reject comments after implicit boolean config keys by Byron · Pull Request #2239 · gitpython-developers/GitPython
X Title: Reject comments after implicit boolean config keys by Byron · Pull Request #2239 · gitpython-developers/GitPython
Description: 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 GPT-6. Created by Codex on behalf of Byron. Byron will review before this is ready to merge. Git rejects bare config keys followed by # or ; comments. GitPython previously accepted those lines with the comment in the option name, and an = or : inside the comment could make the line look like an assignment. Exclude comment markers from the shared option-name expression and require a full-line match for valueless options. Reading or editing these entries now raises ParsingError. Ordinary bare keys retain their implicit true value. Validation Six regression cases compare rejection directly with Git, covering both markers, whitespace and adjacent comments, and assignment delimiters inside comments. The regression checks both boolean reads and attempted edits raise ParsingError, and a failed edit leaves the original file untouched. All six cases failed before full-line matching was added. Python 3.12.14: 42 configuration tests and six regression subtests passed; two existing tests skipped. Ruff lint and formatting and git diff --check passed. Tix change vxuttnt, commit 2d4f068 (fix: reject comments after implicit boolean config keys). The single codex review --commit 2d4f0683341cb77e75a8656484d3c09a441f9d22 attempt could not complete because the Codex CLI refresh token has expired. Git reference Inspected Git checkout 1630431f326e15fcde608827b5ff38422528eb59, particularly config.c:get_value. Without an assignment, Git requires the line to end after the key and optional whitespace. Git 2.50.1 (Apple Git-155) rejects all six regression inputs with exit status 128. Reported issue The compatibility requirement was clarified to match Git's rejection of these entries. Original report: Follow-up to PR 2238: This matches the valueless-option regex against the unprocessed line, so a valid Git entry such as enabled # comment (or enabled ; comment) is stored with the comment text in the option name instead of as enabled. A write-back then emits that text as part of the key, and getboolean("flag", "enabled") still cannot find the option; strip the unquoted comment before extracting the name and add a regression for it.
Open Graph Description: 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 C...
X Description: 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 C...
Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/2239
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:cd06b080-00b7-a5d5-03d5-b47e43ca58e4 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E930:213839:F9DAFF:142066F:6B0100EC |
| html-safe-nonce | ed1de249330379090806c273338baae2b99d81a9112d33a9c7da17acb568ed44 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOTMwOjIxMzgzOTpGOURBRkY6MTQyMDY2Rjo2QjAxMDBFQyIsInZpc2l0b3JfaWQiOiI4NTY2NTA4NDU0ODg4NDA3Mjc2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 96d9006226840669a5fae9e87b95b392b0fc1495bfbac1311b1ad6f079f21b5b |
| hovercard-subject-tag | pull_request:4519590944 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/gitpython-developers/GitPython/pull/2239/files |
| twitter:image | https://avatars.githubusercontent.com/u/63622?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/63622?s=400&v=4 |
| og:image:alt | 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 C... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width