title: git difftool suddenly stopped working / how to troubleshoot?
body: <p>I have set up my <code>git difftool</code> to use <code>winmerge</code>.  It has been working for quite a while.  But it suddenly stopped working today.  <code>git difftool</code> used to invoke <code>winmerge</code> on the dirty files one by one, but not today. The command just returned as if nothing happened.  There were no error messages.  </p>
  
  <p>I double checked and indeed I have several dirty files (as shown by <code>git status</code>)</p>
  
  <p>Any suggestions on how I can troubleshoot the problem?  Thanks!</p>
  
  <p><strong>Updated</strong></p>
  
  <p>Thanks for the suggestion by fabspro.  I made some progress but still
  have not been able to resolve the issue.  </p>
  
  <p>My original setting for <code>winmerge</code> as <code>difftool</code> was this (in my <code>~/.gitconfig</code> file):</p>
  
  <pre><code>[diff]
        tool = winmerge
  </code></pre>
  
  <p>Now I understand that this will direct <code>git difftool</code> to use a script</p>
  
  <pre><code>C:\Program Files\Git\mingw64\libexec\git-core\mergetools
  </code></pre>
  
  <p>on my computer.  I am going to show the contents of this script below.
  I believe the contents are in good shape since no one touched it, and
  it was working before today.</p>
  
  <p>And then I also tried invoking <code>WinMerge</code> directly, so I change
  the directives in <code>~/.gitconfig</code> to this </p>
  
  <pre><code>[diff]
          tool = mywinmerge
  [difftool "mywinmerge"]
          cmd = "\"C:/Program Files (x86)/WinMerge/WinMergeU.exe\" \"$LOCAL\" \"$REMOTE\""
  </code></pre>
  
  <p>This idea came from this SO answer: <a href="https://stackoverflow.com/a/24337687/1168041">https://stackoverflow.com/a/24337687/1168041</a></p>
  
  <p>I double checked the path, and I also checked that in
  my <code>git bash</code> I 
  could invoke <code>WinMerge</code> directly (without argument --
  unlike the config above) using this command:</p>
  
  <pre><code>$ /c/Program\ Files\ \(x86\)/WinMerge/WinMergeU.exe
  </code></pre>
  
  <p>Still, I could not get my <code>git difftool</code> command to work
  (which was working yesterday)</p>
  
  <p>Any more ideas?  Thanks!</p>
  
  <p><strong>Appendix</strong></p>
  
  <p>Contents of my <code>C:\Program Files\Git\mingw64\libexec\git-core\mergetools</code></p>
  
  <pre><code>diff_cmd () {
          "$merge_tool_path" -u -e "$LOCAL" "$REMOTE"
          return 0
  }
  
  merge_cmd () {
          # mergetool.winmerge.trustExitCode is implicitly false.
          # touch $BACKUP so that we can check_unchanged.
          touch "$BACKUP"
          "$merge_tool_path" -u -e -dl Local -dr Remote \
                  "$LOCAL" "$REMOTE" "$MERGED"
          check_unchanged
  }
  
  translate_merge_tool_path() {
          # Use WinMergeU.exe if it exists in $PATH
          if type -p WinMergeU.exe &gt;/dev/null 2&gt;&amp;1
          then
                  printf WinMergeU.exe
                  return
          fi
  
          # Look for WinMergeU.exe in the typical locations
          winmerge_exe="WinMerge/WinMergeU.exe"
          for directory in $(env | grep -Ei '^PROGRAM(FILES(\(X86\))?|W6432)=' |
                  cut -d '=' -f 2- | sort -u)
          do
                  if test -n "$directory" &amp;&amp; test -x "$directory/$winmerge_exe"
                  then
                          printf '%s' "$directory/$winmerge_exe"
                          return
                  fi
          done
  
          printf WinMergeU.exe
  }
  </code></pre>