2

I am trying to use a custom diff tool for git diff. The following command does the job:

git difftool --tool nbdime "file.ipynb"

This starts up a diff viewer on the web, with the following arguments:

{'difftool_args' : {'base': '/tmp/ZpUu2a_1 - file.ipynb',
                    'remote': 'file.ipynb'},
                    'port': 0,
                    'cwd': '/home/user/Projects/prj2'}

However, I need to specify the port for my difftool nbdime

I tried the following (+ other permutations):

git difftool --tool nbdime --port 5555 "file.ipynb"

but none get accepted as an argument to the difftool; so how would one provide an argument to the difftool?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
killajoule
  • 3,612
  • 7
  • 30
  • 36

1 Answers1

0

Regarding nbdime (Tools for diffing and merging of Jupyter notebooks.), since it does take a -p argument, I would wrap that in a script, which would:

Actually, that script exists: nbdime/webapp/nbdifftool.py

I would then use that script in the git difftool --tool directive (without the port, since said port is set within the wrapper script)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250