Add --no-textconv to git diff calls#2743
Conversation
adf2223 to
6691062
Compare
tests/commands/run_test.py
Outdated
|
|
||
| with open('.git/config', 'a') as fp: | ||
| fp.write('[diff "empty"]\n') | ||
| fp.write('textconv = "python -c print()"\n') |
There was a problem hiding this comment.
this should use sys.executable (or maybe even bash) so it doesn't fail on systems with only python3
There was a problem hiding this comment.
Switched to sys.executable
There was a problem hiding this comment.
eheh I think it might have quoting issues now /o\ we'll see what CI says
There was a problem hiding this comment.
echo is only a shell builtin on my system; printf is binary, but it will require printing its args, which can cause a textconv difference since git diff uses a temporary filename for comparison
I added shlex.quote...
There was a problem hiding this comment.
I'm surprised you don't have /bin/echo, it's posix specced iirc
There was a problem hiding this comment.
/bin/echo exists yes, I was just being slow and only checked /usr/bin/.
I have changed the test to use true.
06511f3 to
439a59c
Compare
439a59c to
7783a3e
Compare
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [pre-commit](https://github.com/pre-commit/pre-commit) | dev-dependencies | major | `^2.21.0` -> `^3.0.0` | --- ### Release Notes <details> <summary>pre-commit/pre-commit</summary> ### [`v3.2.2`](https://github.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#​322---2023-04-03) [Compare Source](pre-commit/pre-commit@v3.2.1...v3.2.2) \================== ##### Fixes - Fix support for swift >= 5.8. - [#​2836](pre-commit/pre-commit#2836) PR by [@​edelabar](https://github.com/edelabar). - [#​2835](pre-commit/pre-commit#2835) issue by [@​kgrobelny-intive](https://github.com/kgrobelny-intive). ### [`v3.2.1`](https://github.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#​321---2023-03-25) [Compare Source](pre-commit/pre-commit@v3.2.0...v3.2.1) \================== ##### Fixes - Fix `language_version` for `language: rust` without global `rustup`. - [#​2823](pre-commit/pre-commit#2823) issue by [@​daschuer](https://github.com/daschuer). - [#​2827](pre-commit/pre-commit#2827) PR by [@​asottile](https://github.com/asottile). ### [`v3.2.0`](https://github.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#​320---2023-03-17) [Compare Source](pre-commit/pre-commit@v3.1.1...v3.2.0) \================== ##### Features - Allow `pre-commit`, `pre-push`, and `pre-merge-commit` as `stages`. - [#​2732](pre-commit/pre-commit#2732) issue by [@​asottile](https://github.com/asottile). - [#​2808](pre-commit/pre-commit#2808) PR by [@​asottile](https://github.com/asottile). - Add `pre-rebase` hook support. - [#​2582](pre-commit/pre-commit#2582) issue by [@​BrutalSimplicity](https://github.com/BrutalSimplicity). - [#​2725](pre-commit/pre-commit#2725) PR by [@​mgaligniana](https://github.com/mgaligniana). ##### Fixes - Remove bulky cargo cache from `language: rust` installs. - [#​2820](pre-commit/pre-commit#2820) PR by [@​asottile](https://github.com/asottile). ### [`v3.1.1`](https://github.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#​311---2023-02-27) [Compare Source](pre-commit/pre-commit@v3.1.0...v3.1.1) \================== ##### Fixes - Fix `rust` with `language_version` and a non-writable host `RUSTUP_HOME`. - [pre-commit-ci/issues#​173](pre-commit-ci/issues#173) by [@​Swiftb0y](https://github.com/Swiftb0y). - [#​2788](pre-commit/pre-commit#2788) by [@​asottile](https://github.com/asottile). ### [`v3.1.0`](https://github.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#​310---2023-02-22) [Compare Source](pre-commit/pre-commit@v3.0.4...v3.1.0) \================== ##### Fixes - Fix `dotnet` for `.sln`-based hooks for dotnet>=7.0.200. - [#​2763](pre-commit/pre-commit#2763) PR by [@​m-rsha](https://github.com/m-rsha). - Prevent stashing when `diff` fails to execute. - [#​2774](pre-commit/pre-commit#2774) PR by [@​asottile](https://github.com/asottile). - [#​2773](pre-commit/pre-commit#2773) issue by [@​strubbly](https://github.com/strubbly). - Dependencies are no longer sorted in repository key. - [#​2776](pre-commit/pre-commit#2776) PR by [@​asottile](https://github.com/asottile). ##### Updating - Deprecate `language: python_venv`. Use `language: python` instead. - [#​2746](pre-commit/pre-commit#2746) PR by [@​asottile](https://github.com/asottile). - [#​2734](pre-commit/pre-commit#2734) issue by [@​asottile](https://github.com/asottile). ### [`v3.0.4`](https://github.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#​304---2023-02-03) [Compare Source](pre-commit/pre-commit@v3.0.3...v3.0.4) \================== ##### Fixes - Fix hook diff detection for files affected by `--textconv`. - [#​2743](pre-commit/pre-commit#2743) PR by [@​adamchainz](https://github.com/adamchainz). - [#​2743](pre-commit/pre-commit#2743) issue by [@​adamchainz](https://github.com/adamchainz). ### [`v3.0.3`](https://github.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#​303---2023-02-01) [Compare Source](pre-commit/pre-commit@v3.0.2...v3.0.3) \================== ##### Fixes - Revert "Prevent local `Gemfile` from interfering with hook execution.". - [#​2739](pre-commit/pre-commit#2739) issue by [@​Roguelazer](https://github.com/Roguelazer). - [#​2740](pre-commit/pre-commit#2740) PR by [@​asottile](https://github.com/asottile). ### [`v3.0.2`](https://github.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#​302---2023-01-29) [Compare Source](pre-commit/pre-commit@v3.0.1...v3.0.2) \================== ##### Fixes - Prevent local `Gemfile` from interfering with hook execution. - [#​2727](pre-commit/pre-commit#2727) PR by [@​asottile](https://github.com/asottile). - Fix `language: r`, `repo: local` hooks - [pre-commit-ci/issues#​107](pre-commit-ci/issues#107) by [@​lorenzwalthert](https://github.com/lorenzwalthert). - [#​2728](pre-commit/pre-commit#2728) PR by [@​asottile](https://github.com/asottile). ### [`v3.0.1`](https://github.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#​301---2023-01-26) [Compare Source](pre-commit/pre-commit@v3.0.0...v3.0.1) \================== ##### Fixes - Ensure coursier hooks are available offline after install. - [#​2723](pre-commit/pre-commit#2723) PR by [@​asottile](https://github.com/asottile). ### [`v3.0.0`](https://github.com/pre-commit/pre-commit/blob/HEAD/CHANGELOG.md#​300---2023-01-23) [Compare Source](pre-commit/pre-commit@v2.21.0...v3.0.0) \================== ##### Features - Make `language: golang` bootstrap `go` if not present. - [#​2651](pre-commit/pre-commit#2651) PR by [@​taoufik07](https://github.com/taoufik07). - [#​2649](pre-commit/pre-commit#2649) issue by [@​taoufik07](https://github.com/taoufik07). - `language: coursier` now supports `additional_dependencies` and `repo: local` - [#​2702](pre-commit/pre-commit#2702) PR by [@​asottile](https://github.com/asottile). - Upgrade `ruby-build` to `20221225`. - [#​2718](pre-commit/pre-commit#2718) PR by [@​jalessio](https://github.com/jalessio). ##### Fixes - Improve error message for invalid yaml for `pre-commit autoupdate`. - [#​2686](pre-commit/pre-commit#2686) PR by [@​asottile](https://github.com/asottile). - [#​2685](pre-commit/pre-commit#2685) issue by [@​CarstenGrohmann](https://github.com/CarstenGrohmann). - `repo: local` no longer provisions an empty `git` repo. - [#​2699](pre-commit/pre-commit#2699) PR by [@​asottile](https://github.com/asottile). ##### Updating - Drop support for python<3.8 - [#​2655](pre-commit/pre-commit#2655) PR by [@​asottile](https://github.com/asottile). - Drop support for top-level list, use `pre-commit migrate-config` to update. - [#​2656](pre-commit/pre-commit#2656) PR by [@​asottile](https://github.com/asottile). - Drop support for `sha` to specify revision, use `pre-commit migrate-config` to update. - [#​2657](pre-commit/pre-commit#2657) PR by [@​asottile](https://github.com/asottile). - Remove `pre-commit-validate-config` and `pre-commit-validate-manifest`, use `pre-commit validate-config` and `pre-commit validate-manifest` instead. - [#​2658](pre-commit/pre-commit#2658) PR by [@​asottile](https://github.com/asottile). - `language: golang` hooks must use `go.mod` to specify dependencies - [#​2672](pre-commit/pre-commit#2672) PR by [@​taoufik07](https://github.com/taoufik07). </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS42MS4wIiwidXBkYXRlZEluVmVyIjoiMzUuNjEuMCJ9--> Co-authored-by: Renovate Bot <[email protected]> Reviewed-on: https://git.goatpr0n.de/public/doxy/pulls/2 Co-authored-by: renovate <[email protected]> Co-committed-by: renovate <[email protected]>


Fixes #2742.
I fixed the one in
run.py, fixing the bug. Ithen audited the othergit diffcalls to consider whether text conversion would be suitable there. Those using--name-onlydon't need it, since Git skips text conversion in that case. The diff in_run_hooksis for human consumption doesn't need it because it's for the human to read.