Title: Configparser does not respect order of config files with includes · Issue #627 · gitpython-developers/GitPython · GitHub
Open Graph Title: Configparser does not respect order of config files with includes · Issue #627 · gitpython-developers/GitPython
X Title: Configparser does not respect order of config files with includes · Issue #627 · gitpython-developers/GitPython
Description: When you have an include statement in the user .gitconfig there content will take precedence over the local .git/config of the repository. E.g. the following code: entry = repo.config_reader().get_value('gitlab', 'url') With the followin...
Open Graph Description: When you have an include statement in the user .gitconfig there content will take precedence over the local .git/config of the repository. E.g. the following code: entry = repo.config_reader().get_...
X Description: When you have an include statement in the user .gitconfig there content will take precedence over the local .git/config of the repository. E.g. the following code: entry = repo.config_reader().get_...
Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/627
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Configparser does not respect order of config files with includes","articleBody":"When you have an include statement in the user `.gitconfig` there content will take precedence over the local `.git/config` of the repository.\r\n\r\nE.g. the following code:\r\n`entry = repo.config_reader().get_value('gitlab', 'url')`\r\n\r\nWith the following config setup:\r\n\r\n`~/.gitconfig`:\r\n```ini\r\n[include]\r\n path = ~/.gitconfig-local\r\n[gitlab]\r\n url = url1\r\n```\r\n\r\n`~/.gitconfig-local`:\r\n```ini\r\n[gitlab]\r\n url = url2\r\n```\r\n\r\n`.git/config`:\r\n```ini\r\n[gitlab]\r\n url = url3\r\n```\r\n\r\nWill return `url2` I would expect to receive `url3` instead as local config should take precedence as the include was in a more global config.\r\n\r\nLooks like the issue resides inside the `read ` function e.g. https://github.com/gitpython-developers/GitPython/blob/c823d482d03caa8238b48714af4dec6d9e476520/git/config.py#L427 will just add the includes to the list, which is just wrong, as they should be read instantly to overwrite just the already known configs.\r\n\r\nAs the function is just to big, I'm not able to provide a fix.\r\n\r\nVersions in use:\r\n```\r\n\u003e\u003e\u003e import git; git.__version__\r\n'2.1.3'\r\n```\r\n\r\n```\r\npython --version\r\nPython 2.7.13\r\n```","author":{"url":"https://github.com/DanielSiepmann","@type":"Person","name":"DanielSiepmann"},"datePublished":"2017-05-13T17:03:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/627/GitPython/issues/627"}
| 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:be3974d0-9e10-f95c-d337-6f0a8a6c371a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AE44:10FD0C:6A794E:8EF862:69697424 |
| html-safe-nonce | 7e61d8a589693cf7d0709766c79c2c0cf593503934c1f707607c51326318409a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRTQ0OjEwRkQwQzo2QTc5NEU6OEVGODYyOjY5Njk3NDI0IiwidmlzaXRvcl9pZCI6IjIxODE1NDY4MDc3NTk4MjgwMDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 077b47746f9044bc52aeb6035ab5a002cc742541ec4f3f09266c3e21be7a3289 |
| hovercard-subject-tag | issue:228486034 |
| 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/627/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a6bf0e57ed835d498cc642400454ac9c2170b378f4cf421d6a7f2cb11ca3f588/gitpython-developers/GitPython/issues/627 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a6bf0e57ed835d498cc642400454ac9c2170b378f4cf421d6a7f2cb11ca3f588/gitpython-developers/GitPython/issues/627 |
| og:image:alt | When you have an include statement in the user .gitconfig there content will take precedence over the local .git/config of the repository. E.g. the following code: entry = repo.config_reader().get_... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DanielSiepmann |
| hostname | github.com |
| expected-hostname | github.com |
| None | c6f193beb8ff08443adc07685d75302ab8aaf0a135f6e251c3ff3112c8deb881 |
| 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 | 212e3e3d3298bf5b313830edfd2399e869f7ea76 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width