Title: Config lookups are case-sensitive, where git's section and variable names are not · Issue #2240 · gitpython-developers/GitPython · GitHub
Open Graph Title: Config lookups are case-sensitive, where git's section and variable names are not · Issue #2240 · gitpython-developers/GitPython
X Title: Config lookups are case-sensitive, where git's section and variable names are not · Issue #2240 · gitpython-developers/GitPython
Description: git matches section names and variable names case-insensitively; only the subsection between quotes is case-sensitive. GitConfigParser matches all three exactly, so a config written with different casing is unreadable through it. Against...
Open Graph Description: git matches section names and variable names case-insensitively; only the subsection between quotes is case-sensitive. GitConfigParser matches all three exactly, so a config written with different ...
X Description: git matches section names and variable names case-insensitively; only the subsection between quotes is case-sensitive. GitConfigParser matches all three exactly, so a config written with different ...
Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/2240
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Config lookups are case-sensitive, where git's section and variable names are not","articleBody":"git matches section names and variable names case-insensitively; only the subsection between quotes is case-sensitive. `GitConfigParser` matches all three exactly, so a config written with different casing is unreadable through it.\n\nAgainst this file:\n\n```ini\n[core]\n\tBigName = 1\n[REMOTE \"Origin\"]\n\turl = u\n```\n\n```\nlookup git GitPython\ncore.BigName 1 1\ncore.bigname 1 NoOptionError\nREMOTE \"Origin\".url u u\nremote \"Origin\".url u NoSectionError\n```\n\nThe variable half comes from `optionxform` being overridden to identity (`git/config.py:439`):\n\n```python\ndef optionxform(self, optionstr: str) -> str:\n \"\"\"Do not transform options in any way when writing.\"\"\"\n return optionstr\n```\n\nThe docstring says \"when writing\", and preserving case on write is right, since git keeps the spelling it was given. The same function decides how lookups are matched though, so reads inherit it.\n\nThis bites when the file was written by something other than GitPython: git itself preserves whatever casing the user typed, and other tools emit `[remote \"x\"]` or `[Remote \"x\"]` interchangeably, so `repo.config_reader().get_value(\"remote \\\"x\\\"\", \"url\")` can raise on a perfectly valid config.\n\nI have not sent a patch because the fix is a behaviour change with more than one shape: case-folding lookups only, or folding on read while keeping the written spelling, and either way `sections()` and `items()` start returning something different from what they return today. Happy to do it if you say which.\n\nUnrelated to #2237, which I filed yesterday about valueless keys, but both are in the same `_read`/lookup path so you may want to look at them together.\n\ngit 2.50.1, GitPython at a9913c7.\n\nAssisted-by: Claude Opus 5 (Claude Code), per the identification rule in CONTRIBUTING.md.","author":{"url":"https://github.com/rawsun007","@type":"Person","name":"rawsun007"},"datePublished":"2026-09-14T02:56:52Z","url":"https://github.com/gitpython-developers/GitPython/issues/2240"}
| 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 | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3dc620af-5096-6766-6f3b-6dd51a1c08e5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 857A:29AEE8:D76C61:12021E0:6B0100BA |
| html-safe-nonce | c16285a9dc616d4d43721e0140f5296931e601e1913a4f2500dbda175edff0d4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTdBOjI5QUVFODpENzZDNjE6MTIwMjFFMDo2QjAxMDBCQSIsInZpc2l0b3JfaWQiOiIyNDc3NDg1OTU0NDQ5ODY2OTM4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a29b6ce78b442ce7426718f00c9f19a2286d4b9dbb44a7200e914fa56808a735 |
| hovercard-subject-tag | issue:5444637571 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/gitpython-developers/GitPython/2240/issue_layout |
| twitter:image | https://opengraph.githubassets.com/aca7005e75a902697f15988ef2e447392bce14273cf4cf26d9c970722b425fc7/gitpython-developers/GitPython/issues/2240 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/aca7005e75a902697f15988ef2e447392bce14273cf4cf26d9c970722b425fc7/gitpython-developers/GitPython/issues/2240 |
| og:image:alt | git matches section names and variable names case-insensitively; only the subsection between quotes is case-sensitive. GitConfigParser matches all three exactly, so a config written with different ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rawsun007 |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | false |
| 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 |
| react-app-name | issues |
Links:
Viewport: width=device-width