Title: feat(cmd): add the `strip_newline` flag by toku-sa-n · Pull Request #1423 · gitpython-developers/GitPython · GitHub
Open Graph Title: feat(cmd): add the `strip_newline` flag by toku-sa-n · Pull Request #1423 · gitpython-developers/GitPython
X Title: feat(cmd): add the `strip_newline` flag by toku-sa-n · Pull Request #1423 · gitpython-developers/GitPython
Description: This PR adds the strip_newline flag to the Git.execute method. When this flag is set to True, it will trim the trailing \n. The default value is True for backward compatibility. Setting it to False is helpful for, e.g., the git show output, especially with the binary file, as the missing \n may invalidate the file. Looking at the first some bytes and checking if the output is binary or not is another option to prevent making an invalid binary file. Still, I chose to add a parameter because it is easy to implement, is fully backward compatible, and doesn't add many lines to the source code. Fixes: #1377 By the way, do we need to handle stderr too?
Open Graph Description: This PR adds the strip_newline flag to the Git.execute method. When this flag is set to True, it will trim the trailing \n. The default value is True for backward compatibility. Setting it to False...
X Description: This PR adds the strip_newline flag to the Git.execute method. When this flag is set to True, it will trim the trailing \n. The default value is True for backward compatibility. Setting it to False...
Opengraph URL: https://github.com/gitpython-developers/GitPython/pull/1423
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:3452493e-6f4f-de24-72a6-414a2f853f5e |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CED4:105924:9DCBC7:D76A89:69695863 |
| html-safe-nonce | 5569d7c14cb7c1b6e8a49534d0688a2d11d3ea1eef0ab634b0399eddf44d940a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRUQ0OjEwNTkyNDo5RENCQzc6RDc2QTg5OjY5Njk1ODYzIiwidmlzaXRvcl9pZCI6Ijc4MDUwNzMzMDA4ODk2MjI2MjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | cb11b570faf26f2e9296ebeadcc3dc3908e9f1b727b89f2ed7a39305d3f237c6 |
| hovercard-subject-tag | pull_request:901575636 |
| 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/1423/files |
| twitter:image | https://avatars.githubusercontent.com/u/42336339?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/42336339?s=400&v=4 |
| og:image:alt | This PR adds the strip_newline flag to the Git.execute method. When this flag is set to True, it will trim the trailing \n. The default value is True for backward compatibility. Setting it to False... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9db5f28da7e24035385d7f349f17890cbe016a939ddd7952be0f07b862094f5a |
| 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 | 4e59fe66217d3c72925af2a341ae3a8f2b5b5b2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width