BC4 as difftool not working for git version 2.12.0.windows.1

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gatsu
    Visitor
    • Mar 2017
    • 5

    BC4 as difftool not working for git version 2.12.0.windows.1

    I tried to respond to a relevant thread about this subject but it doesn't look like I'm able to post there. I can use BC4 as a mergetool but not the difftool

    To give you all relevant information

    Downloaded and installed from https://git-scm.com/downloads
    using Git Bash exclusively, but when installed did the second option (install git for windows command line) if that matters.
    In windows 10 64 pro

    when running "git difftool file" it shows the default output of git diff (all in bash). there is no error. When running "git mergetool file" beyond compare launches as it should. Below is my setup.

    $ git --version
    git version 2.12.0.windows.1

    [merge]
    tool = bc
    [mergetool "bc"]
    path = c:/program files/beyond compare 4/bcomp.exe
    [diff]
    tool = bc
    [difftool "bc"]
    path = c:/program files/beyond compare 4/bcomp.exe


    The only other additional thing being used is git LFS.
  • Aaron
    Team Scooter
    • Oct 2007
    • 16002

    #2
    Hello,

    Our recommended setup for Git for Windows is here:
    http://www.scootersoftware.com/suppo...vcs#gitwindows

    Git uses a keyword "bc3" (even for bc4) that detects and builds in support for BC4. If you switch to "bc3" and restart (to be sure the new settings are applied), I'd expect commands like difftool to begin working.
    Aaron P Scooter Software

    Comment

    • gatsu
      Visitor
      • Mar 2017
      • 5

      #3
      Sorry if I am mistaken Aaron but it doesn't look like you read my post. It is working as it should for mergetool just as my post explains, I also followed the instructions at http://www.scootersoftware.com/suppo...vcs#gitwindows exactly. You need to either update your outdated support articles or explain why this bug is present. If there is a support option for paying customers please let us know as we would like non-canned responses.

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 16002

        #4
        We offer the same support in both ways, and I did read your post. You used the keyword "bc", such as:
        [difftool "bc"]

        However, Git uses "bc3" to internally identify and use Beyond Compare 3 and Beyond Compare 4. Using "bc" might work, but then it wouldn't recognize it is calling Beyond Compare, it would call a the difftool and mergetool generically.
        Git has extra hooks to 'just make it work' by using "bc3", as documented in the link I provided. This is an internal Git behavior, and not something under our control.

        Update: Also be sure to restart. Git caches .gitconfig settings, so edits are sometimes not applied until the git process is fully restarted. If you are seeing failure after the edit, reboot your machine just to be sure the correct .gitconfig settings are being pulled in.
        Last edited by Aaron; 21-Mar-2017, 10:41 AM. Reason: Update: Reboot to avoid caching
        Aaron P Scooter Software

        Comment

        • gatsu
          Visitor
          • Mar 2017
          • 5

          #5
          Aaron I would advise you to take the time to read your own link: http://www.scootersoftware.com/suppo...vcs#gitwindows

          Please take careful note of the wording at the bottom of BC Version 4. If you need help with the software please ask your manager for help and then please have them contact us in this thread or by phone. There are two possibilities to what's happened here either:

          A: You're correct and the documentation you have on your site is inaccurate, but you still link people to it expecting them automatically ignore the inaccuracies or
          B: You are wrong and the documentation is correct. In that case the software has a bug.

          Comment

          • Chris
            Team Scooter
            • Oct 2007
            • 5538

            #6
            I received your voicemail about the Git issue. I'm reviewing the documentation and setting up a test environment to verify the instructions, then I'll follow up with you by phone later today.
            Chris K Scooter Software

            Comment

            • Chris
              Team Scooter
              • Oct 2007
              • 5538

              #7
              I tested the Git for Windows instructions on our website, they are valid for git version 2.12.0.windows.1. Git for Windows version 2.12.0 supports both bc and bc3 keywords when defining diff and merge tools.

              Test environment:
              Windows 10 Pro 64
              Git for Windows 2.12.0
              Beyond Compare 4.1.9 Pro
              Git Bash Shell

              Configuration as diff and merge tool:
              Code:
              git config --global diff.tool bc3
              git config --global difftool.bc3.path "c:/program files/beyond compare 4/bcomp.exe"
              git config --global merge.tool bc3
              git config --global mergetool.bc3.path "c:/program files/beyond compare 4/bcomp.exe"
              To launch a diff from Git Bash shell:
              Code:
              git difftool file.ext
              Configuring using bc rather than bc3 also works for git 2.12.0:
              Code:
              git config --global diff.tool bc
              git config --global difftool.bc.path "c:/program files/beyond compare 4/bcomp.exe"
              git config --global merge.tool bc
              git config --global mergetool.bc.path "c:/program files/beyond compare 4/bcomp.exe"
              Our website documentation uses bc3 rather than bc because it's compatible with both newer and older versions of git.

              The merge tool definitions are in the files:
              Code:
              C:\Program Files\Git\mingw64\libexec\git-core\mergetools\bc
              C:\Program Files\Git\mingw64\libexec\git-core\mergetools\bc3
              The bc3 file just refers to the settings in the bc file, so both definitions are valid.

              If the above instructions aren't working on your system, it's possible repository local settings are overriding the global settings.

              The contents of the global git config file (c:\users\username\.gitconfig) from my working test system:
              Code:
              [diff]
                      tool = bc3
              [difftool "bc3"]
                      path = c:/program files/beyond compare 4/bcomp.exe
              [merge]
                      tool = bc3
              [mergetool "bc3"]
                      path = c:/program files/beyond compare 4/bcomp.exe
              To check your repository local git configuration, run the command "git config --list" from your repository.

              Diff related output of "git config --list" from the working repository on my test system.
              Code:
              diff.tool=bc3
              difftool.bc3.path=c:/program files/beyond compare 4/bcomp.exe

              You can also check repository specific git config by looking at the file .git/config in your repository.

              If you continue to have trouble, please email your Beyond Compare settings, your c:\users\username\.gitconfig, and your repository .git/config to [email protected] and I'll investigate further. To save your settings to a file, open Help > Support and click the Export button.

              Chris Kennedy
              Technical Support and QA Team Lead
              Last edited by Chris; 22-Mar-2017, 01:30 PM.
              Chris K Scooter Software

              Comment

              • Chris
                Team Scooter
                • Oct 2007
                • 5538

                #8
                gatsu,

                I just followed up with a phone call to your office, but you were unavailable. If you'd like to discuss your issue by phone rather than web forum or email, our phone number and office hours are listed on the contact page of our website: http://www.scootersoftware.com/index.php?zz=contact
                Chris K Scooter Software

                Comment

                • ixe013
                  New User
                  • May 2017
                  • 1

                  #9
                  Hey Chris,

                  I'm having the same problem as @gatsu. I am using version 4.1.1 (build 20615) 64 bit edition, and tried with Git 2.10 and 2.13.

                  Like him, the explications I see on the support website don't match your test. And neither works for me. Might be that I run git from CMD, not git bash...

                  I beleive you are using 64 bit BeyondCompare also. The instructions on the support website are for a 32bit edition. The binary is in a different folder...

                  Will hunt for a solution some more, maybe writing a small thingy to display the parameters received and replace BComp.exe with that, just to see if it is called by Git or not...

                  Comment

                  • Aaron
                    Team Scooter
                    • Oct 2007
                    • 16002

                    #10
                    Hello,

                    Please update to BC 4.2.2. All BC 4.x updates are free for 4.x users.

                    The install folder by default is either Program Files\ or Program Files (x86)\. This depends on if there was a pre-existing BC4.0 install before a 4.1 upgrade. BC4's upgrade prioritizes leaving it in the current directory, but fresh 4.1 installs are placed in the regular, 64bit Program Files\.
                    The documentation notes that if the install path is different you should substitute the correct install path on your system:
                    32-bit Windows users should replace "C:\Program Files (x86)" with "C:\Program Files".
                    64-bit Windows users with a fresh install of BC 4.1+ should replace "C:\Program Files (x86)" with "C:\Program Files".

                    I just tested with Git 2.12 and 2.13.0.windows.1, using the Git Bash, and was able to use git difftool without issue. We do see some problems crop up from time to time, as changes in Git can introduce different behavior (like, my previous comments about bc3 that used to be a requirement, before they patched and added bc).
                    Aaron P Scooter Software

                    Comment

                    • roelandsch
                      Journeyman
                      • Nov 2016
                      • 11

                      #11
                      As pointed out on https://superuser.com/questions/5837...ommand-prompt:

                      git difftool and git difftool path/to/file will always print the diff on the console
                      git difftool head and git difftool head path/to/file will use Beyond compare (or whatever you configured) to show the diff.

                      For whatever reason which seems to be missing from the GIT manual.

                      Comment

                      • Aaron
                        Team Scooter
                        • Oct 2007
                        • 16002

                        #12
                        Hello,

                        That sounds like a bug with the specific version of Git, or the .gitconfig is not properly configured for the current command line (git bash or command line) you are using.

                        I would suggest running the --config command lines documented here on the same command line you are executing the "git difftool" command:
                        http://www.scootersoftware.com/suppo...vcs#gitwindows

                        This will help verify that the .gitconfig for the current view is configured, which should prompt for "Viewing (1/X) 'file.txt'. Launch bc [Y/n]"

                        I would also suggest updating Git.
                        Aaron P Scooter Software

                        Comment

                        • pdcoxhead
                          New User
                          • Jul 2018
                          • 2

                          #13
                          POSIX to Windows path conversion

                          I've been using Beyond Compare with git for ages (using MacOS) but then I hit this sort of issue when trying to integrate with the new Windows Ubuntu bash tooling. I found a problem to do with the conversion of the posix folder path to windows. Once I found a way to convert the path to Windows both of the files appeared correctly. Word of warning though, apparently you're not supposed to edit the posix files with windows applications. I did have some strange behaviour with one file disappearing from the posix fs but still visible on the windows fs.

                          The script I found for converting from posix to windows paths can be found here : https://github.com/laurent22/wslpath. I did have to make one modification so that the /tmp/ files could be found by BC4. I mentioned it in issue #7. The patch I mentioned was applied to commit b9e739c654274e600dca6a2435f8a40db24036fd on my local machine.

                          Comment

                          • ggirard07
                            New User
                            • Feb 2019
                            • 1

                            #14
                            Same problem here. I can confirm this is related to using cmd/powershell (
                            Code:
                            git version 2.20.1.windows.1
                            ).

                            By using the instruction you provided, git difftool works in Git Bash (mingw) and WSL, but not while in a cmd or powershell session.
                            This is annoying when using VS Code as default terminal is either cmd or powershell, not mingw.

                            Comment

                            • Aaron
                              Team Scooter
                              • Oct 2007
                              • 16002

                              #15
                              Hello,

                              Installing Git for Windows with the default options does not install the necessary components to use Git from the command line. During the Git for Windows setup.exe wizard, you can select to use git bash or git from the Windows Command line. If you select command line, then both the Windows Command Line, Powershell, and VS Code's Terminal: CMD or Powershell window will then support and recognize "git". At this point, I found git difftool correctly used the .gitconfig and called/launched BC4.

                              I didn't find a difference in behavior between using the Command Line and Powershell, or the Terminal in VS Code. It seemed to either work in either, or had the same setup issues in either.

                              VS Code also has an option to natively support git, and the terminal can be set to be a Git Bash (which works with the default Git for Windows bash setup).
                              Aaron P Scooter Software

                              Comment

                              Working...