Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reset external diff tool per command

I've recently installed a new diff tool (difftastic), which messes with my habit of copying diffs to clipboard (or to file) to send those:

[diff]
    external = difft # As per https://difftastic.wilfred.me.uk/git.html
                                | what I want | what I get |
                                | ----------- | ---------- |
$ git diff                      | difft       | difft      |
$ git diff > some-file          | git diff    | difft      |
$ GIT_EXTERNAL_DIFF= git diff   | git diff    | error      |

My end goal is to have a single command to which I can pass usual git diff arguments and get the original (something like git diff --internal basically.

Eventually I'll go upstream to difftastic and offer a PR fixing that (e.g. difftastic defaulting to using git if piped), but I'm almost certain I don't understand correctly git's diff.external and difftool* configs. And I don't know how to reset diff.external per command

like image 873
Ulysse BN Avatar asked Oct 15 '25 18:10

Ulysse BN


1 Answers

A partial solution I found thanks to matt's comments on the question:

git diff --no-ext-diff

Yet I'm sure there are cleaner solution to better choose between either git diff is piped, hence use normal patch or git diff isn't hence do the fancy thing.

like image 100
Ulysse BN Avatar answered Oct 17 '25 10:10

Ulysse BN



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!