Git Difftool p4merge Unexpected Prompt on Diff

168 views Asked by At

When running git difftool I am being prompted for file diff, even though I have prompt = false in my .gitconfig file.

Snippet from .gitconfig

[diff]
  tool = p4mergetool
  renames = copies
  mnemonicprefix = true
[difftool "p4mergetool"]
  cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "$LOCAL" "$REMOTE"
  keepBackup = false
  keepTemporaries = false
  trustExitCode = false
  prompt = false

My .gitconfig entries were based on this answer on the Ask Different exchange.

macOS Terminal Output (bash)

$ git difftool factory-test HEAD -- $(git difftool factory-test HEAD --name-only *.c *.h)
Viewing (1/13): 'factory_test/config/sl_spidrv_usart_spidrv_config.h'
Launch 'p4mergetool' [Y/n]? Y
Viewing (2/13): 'factory_test/app.c'
Launch 'p4mergetool' [Y/n]?

How do I get the prompt suppression to take effect?

My version infos:

  • p4merge (Rev. Helix Merge/MACOSX1015X86_64/2021.1/2085655)
  • git (git version 2.31.1)
  • macOS Catalina (Version 10.15.7)
1

There are 1 answers

0
Jim Fell On BEST ANSWER

Here is the solution:

[diff]
  tool = p4mergetool
[difftool]
  prompt = false
[difftool "p4mergetool"]
  cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "$LOCAL" "$REMOTE"
  keepBackup = false
  keepTemporaries = false
  trustExitCode = false