Invoking external difftool from git-gui?

2020-07-15 04:47发布

问题:

I have p4merge configured so that from the command line if I do a "git difftool ... " then the external diff tool opens up correctly.

I would like to open the external difftool from "git gui" instead of the command line. Is this possible?

Is seems git-gui allows one to add a tool. But it is unclear to me how to get it working. Any pointers?

回答1:

If you already have git difftool set up you can add an item for it:


Add Tool dialog transcription:

Tool Details box:
    Name: difftool
    Command: git difftool $FILENAME

Show a dialog before running: unchecked
    Ask the user to select a revision (sets $REVISION): unchecked
    Ask the user for additional arguments (sets $ARGS): unchecked

Don't show the command output window: checked
Run only if a diff is selected ($FILENAME not empty): checked
  Add globally: checked

Not super-useful though, since there doesn't seem to be a way to assign a hotkey or double-click action to it.

Might need to add a -y to the difftool command if it's asking you annoying questions.