Title: Suggest full-path refresh() in failure message by EliahKagan · Pull Request #1844 · gitpython-developers/GitPython · GitHub
Open Graph Title: Suggest full-path refresh() in failure message by EliahKagan · Pull Request #1844 · gitpython-developers/GitPython
X Title: Suggest full-path refresh() in failure message by EliahKagan · Pull Request #1844 · gitpython-developers/GitPython
Description: This makes the refresh failure message fill in the made-up path "/full/path/to/git" as an argument to git.refresh. This small expansion serves two purposes: To clarify what kind of explicit refresh is being described: passing a path to git.refresh. To clarify what kind of path should typically be used when this is done: a full path. The latter clarification is more important because it cannot be reasoned out from the message and the interface of git.refresh and related functions, though it can be learned from their docstrings since #1829, from their implementations, or by trial and error. I'm not sure how much I like the change in the error message. It seems better than before, but there are three weaknesses: The path passed to git.refresh doesn't actually have to be a full path. Since this is an item listed under "must be specified in one of the following ways," from this proposed wording one can infer the false claim that git.refresh(path), where path is a relative path, never works. It is rarely what one would want, but it can work and has been deliberately supported (just not clearly documented) for quite some time. To limit the length of the message, which already packs in a lot of information (the string it is part of is concatenated to other strings to produce a message that is often taller than one's terminal), I only added an argument. I didn't add a statement that one should usually pass a full path. I think that's the right choice, given how much information is already in this message and how one should usually use one of the other techniques to let GitPython find the git executable anyway. But I'm not sure. Full paths don't always look like that. In particular, on Windows they usually start with a drive letter. Maybe the message should be customized for Windows to start with C:? (C: is not always the relevant drive, but I think having it vary based on the current drive or any other aspects of the current location is not justified.) This pull request also makes a small change to the wording in the Git.refresh docstring from #1829, which could have been read to mean the opposite of what I intended.
Open Graph Description: This makes the refresh failure message fill in the made-up path "/full/path/to/git" as an argument to git.refresh. This small expansion serves two purposes: To clarify what kind of expli...
X Description: This makes the refresh failure message fill in the made-up path "/full/path/to/git" as an argument to git.refresh. This small expansion serves two purposes: To clarify what kind ...
Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/1844
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:789278e9-eb11-f510-1603-5ece8f0f642b |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DF48:32E6C6:78E422:AD021B:69689277 |
| html-safe-nonce | 9d5c125cc956e74f74dd701e26dab5b238534cdf074c1b9314e47e28f84c0b11 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjQ4OjMyRTZDNjo3OEU0MjI6QUQwMjFCOjY5Njg5Mjc3IiwidmlzaXRvcl9pZCI6IjcxMzU0MTA3NzA0MjA0NzAzOTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 464a4dc0a75145fa5b285d40685e8ad65db40dd8649fff6a04861a7bf352da5a |
| hovercard-subject-tag | pull_request:1741517220 |
| 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/1844/files |
| 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 | This makes the refresh failure message fill in the made-up path "/full/path/to/git" as an argument to git.refresh. This small expansion serves two purposes: To clarify what kind of expli... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 50f46dc2d6192249fd8ebf20e76c800f4f2596d4a5f3ab63dd63a754df154f54 |
| 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 |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | fef287f17234b4529a4b112a3d47fe8551e32ddd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width