Title: Improve static typing and docstrings related to git object types by EliahKagan · Pull Request #1859 · gitpython-developers/GitPython · GitHub
Open Graph Title: Improve static typing and docstrings related to git object types by EliahKagan · Pull Request #1859 · gitpython-developers/GitPython
X Title: Improve static typing and docstrings related to git object types by EliahKagan · Pull Request #1859 · gitpython-developers/GitPython
Description: Fixes #1857 Fixes #1858 Fixes #1866 Fixes #1873 Fixes #1874 Fixes #1875 Note: This pull request expanded considerably in scope since first opened, which its title reflects but the rest of this description does not. See comments for details. Main changes This expands the docstrings of Object and some of its subclasses. These revisions are, in large part, to explain the classes' relationships to the git concept of objects and to the corresponding git object types, including links to relevant definitions in gitglossary(7). This also adds docstrings to all the types introduced in git.types--those that relate directly to git object types and those that do not. Adding documentation in git.types relates topically to the docstring expansions for Object and some of its subclasses, and I tried to make all new and edited docstrings make sense whether read by themselves or together with other docstrings across modules. It also relates to the goal for git.types documentation articulated in #1854 (comment). Other changes This also includes some other changes that are less core to that scope but that seem practically useful to include. It revises the docstring for assert_never, which had been the only docstring in git.types, and modifies the string of the default exception it raises to print the repr rather than the str. It removes some long-unused nonpublic names at module level, and revises some method docstrings of classes whose class docstrings were being revised. It also expands the git.compat module docstring, toward the goal for it that was also articulated in #1854 (comment). Considerations for assert_never The change to assert_never, which includes making the docstring accurately describe the current (and established) behavior of the function, may fix #1857. However, as described there I am unsure if this is ultimately the right change there. Considerations for Commit_ish docstring (including possible inaccuracies) Even more important is the relationship of the Commit_ish docstring to #1858. I have said this PR "may" fix that issue, but I strongly suspect that either further refinement will be needed or that a significantly greater change, possibly outside the scope of this PR, may be needed. Furthermore, some of the text in that docstring may require improvement before being suitable for merging. To facilitate writing the docstrings in git.types, including related docstrings and even other parts of the Commit_ish docstring, I wrote text in two parts of the Commit_ish docstring that sound plausible but that I am not at all sure are correct. This is in regard to the question, detailed in #1858, of why Commit_ish union includes the never-commitish Tree and Blob classes. (Even if what I wrote turns out to be correct, it may need to be clarified.) I have opened review comments on those potentially inaccurate lines.
Open Graph Description: Fixes #1857 Fixes #1858 Fixes #1866 Fixes #1873 Fixes #1874 Fixes #1875 Note: This pull request expanded considerably in scope since first opened, which its title reflects but the rest of this desc...
X Description: Fixes #1857 Fixes #1858 Fixes #1866 Fixes #1873 Fixes #1874 Fixes #1875 Note: This pull request expanded considerably in scope since first opened, which its title reflects but the rest of this desc...
Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/1859
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:d235b9fd-f620-89be-9c3b-8f468336eae5 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | A17E:3119CD:824DE2:B6FDF1:696907DE |
| html-safe-nonce | 7c50b103c44039a46a3910ebd07cab3b2524269133d55801ec3d5dacc7949f2e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTdFOjMxMTlDRDo4MjRERTI6QjZGREYxOjY5NjkwN0RFIiwidmlzaXRvcl9pZCI6IjgzMjcwNTMyMDA0OTcxMTcxNTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7633aacd78de4df572ea842988e33d0a402276b8b286f34914a2db2e2a72890e |
| hovercard-subject-tag | pull_request:1755574149 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/1859/checks |
| twitter:image | https://avatars.githubusercontent.com/u/1771172?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1771172?s=400&v=4 |
| og:image:alt | Fixes #1857 Fixes #1858 Fixes #1866 Fixes #1873 Fixes #1874 Fixes #1875 Note: This pull request expanded considerably in scope since first opened, which its title reflects but the rest of this desc... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | e6156bd4ef9f2dc8dadf4c49a8f7ed8532186388cef72eda3ccb9f0ab3b8cfca |
| 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 full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ee2210c3e58153aae53400c942f8a7b4bbb43ec4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width