Use Komodo with external git diff tool


#1

Aaahh now I remember why I disabled it (git extension) a few months ago… every time I make a small edit, Komodo opens a diff window :cry:
Is there a way to disable such behaviour?


Git branch switch
#2

When it opens a diff window? It could be an userscript, try to restart with tools disabled. (Help - troubleshooting)


#3

As soon as I hit “save” with a modify, it opens my external diff tool. If I edit back and save to the original state (e.g. the file is not “not staged for commit”), the diff is not opening.
I also tried to restart without tools, it’s the same.


#4

You have a custom diff tool configured for git, either remove this configuration or configure your Komodo environment to use a different git config.


KomodoV12 svn diff triggers FileMerge
#5

Thank you @nathanr
Can you point me to a documentation to configure my Komodo environment to use a different git config?


#6

We don’t have documentation on that, it is a very specific use-case, we cannot cover every possible use-case in our docs :frowning:

I don’t know what the exact steps would be, it depends on how git configures itself in this regard. Likely you can set an environment variable to override the diff tool or to override your git config path.

Check out:

https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables

In particular the following 2 ENV vars seem to be of interest:

  • GIT_DIFF_OPTS is a bit of a misnomer. The only valid values are -u or --unified=, which controls the number of context lines shown in a git diff command.
  • GIT_EXTERNAL_DIFF is used as an override for the diff.external configuration value. If it’s set, Git will invoke this program when git diff is invoked.

You can set these in Komodo under Preferences > Environment.


#7

Well, I’d like to keep my external diff tool to use outside Komodo, but also getting Komodo working with default git diff.
Unfortunately, I can’t find a way to set a value for GIT_EXTERNAL_DIFF that is restoring the default git diff, so I don’t know what to put inside Komodo environment variables.


#8

What does your git config look like?


#9
[color]
    ui = true
[user]
    name = Massimiliano Arione
    email = garakkio@gmail.com
[diff]
    external = git-meld
[core]
    excludesfile = ~/.gitignore
    attributesfile = ~/.gitattributes
[push]
    default = simple
[diff "image"]
    command = /usr/local/bin/imgdiff.sh

#10

Have you tried setting

GIT_EXTERNAL_DIFF = diff

In Komodo’s Pref > Environment ?


GIT_EXTERNAL_DIFF not working properly
#11

OK, I ended up solving by creating following script:

#!/bin/bash
diff "$2" "$5"

exit 0

put such script in /usr/local/bin/git-diff-komodo.sh and set GIT_EXTERNAL_DIFF = git-diff-komodo.sh

Thanks for the help @nathanr


#12

That’s odd that you needed that, I would think GIT_EXTERNAL_DIFF = diff would effectively achieve the same thing. Anyway, thanks for the update!