question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Command `run` should allow external `diff` drivers on `--show-diff-on-failure`

See original GitHub issue

Currently, pre-commit doesn’t allow external diff drivers to be used when --show-diff-on-failure. This is a convenient feature to have since default diff drivers are not so human readable, especially on trailing whitespace changes.

With default driver: image

With a custom (diff-so-fancy) driver specified in the .gitconfig of the user: image

In practice, --no-ext-diff shouldn’t be enforced. See https://github.com/pre-commit/pre-commit/blob/main/pre_commit/commands/run.py#L306 .

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
asottilecommented, Mar 28, 2022

there’s no pipe there

I’m not changing it, stop arguing you are wasting your time and my time

0reactions
ljmf00commented, Mar 28, 2022

if you want custom behaviour use || (your custom behaviour here && exit 1)

Piping the output is an option, but if we consider that hooks could output a unified diff format in the middle of the output, this is not ideal.

invoking a custom diff tool can hang the program indefinitely while waiting for interaction so it is intentionally avoided

External drivers can even open UI tools, but that’s the user option to do so. What about just allowing custom pagers then? In contrast to external diff drivers, pagers are intended to output on the TTY and check for TTY interactiveness.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: external diff stopped working - Atlassian Community
gitconfig file updated. I've manually added diff tools to it and it works from command line. [difftool "sourcetree"] cmd = 'C:\\Program ...
Read more >
Using custom diff tool with `git show` - Stack Overflow
We need to modify our gitattributes to use our custom driver. The gitattributes file consist of a syntax similar to filename value [value2...
Read more >
Allow disabling external diff drivers everywhere #2069 - GitHub
Hi! When I use git on a command line, I have configured external diff (namely patdiff). Unfortunately, I cannot configure its output to...
Read more >
Release Notes — Airflow Documentation
This allows DAG runs to be automatically created as a result of a task “producing” a dataset. In some ways this can be...
Read more >
diff-config Documentation - Git
Instead, silently run git update-index --refresh to update the cached stat ... The defaults can be overridden on the command line (using ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found