SourceTree and BeyondCompare not working for several SourceTree versions.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rgomez
    Visitor
    • Dec 2018
    • 6

    SourceTree and BeyondCompare not working for several SourceTree versions.

    Hello,

    I am using BeyondCompare 4 Pro and SourceTree 3.0.12, in Windows 10 Pro.

    I've been experiencing since maybe 2 or 3 months of SourceTree updates problem using BeyondCompare 4. All points to some bug on SourceTree, as apparently they are not replacing the $MARKERS for the correct filenames, so I get a command line like this:

    "C:\Program Files\Beyond Compare 4\BCompare.exe" "$LOCAL" "$REMOTE" "<the actual file 1>" "<the actual file 2>"

    I can remove from the SourceTree diff configuration the $LOCAL and $REMOTE macros and the diff works, but when doing a merge that needs more params it fails.

    I've asked on the SourceTree forums but so far nothing. There have been some other messages and bugs reported to Atlassian regarding the Diff configuration not being saved, or things like that, but nothing. I wonder if there is something wrong with my configuration, but I can't find anything.

    Any ideas?
  • Chris
    Team Scooter
    • Oct 2007
    • 5538

    #2
    Recent versions of SourceTree are buggy in the method they use to call Beyond Compare. They should be calling bcomp.exe, not bcompare.exe.

    SourceTree issue tracker: SourceTree opens the external diff tool incorrectly.

    Defining Beyond Compare as a custom diff and merge tool rather than using SourceTree's Beyond Compare preset might fix the problem.

    Solution I posted as a comment in the above issue tracker link:

    Code:
    Run SourceTree.
    Open Tools > Options.
    Go to the Diff tab.
    
    External Diff Tool: Custom
    Diff Command: C:\Program Files\Beyond Compare 4\BComp.exe
    Arguments: \"$LOCAL\" \"$REMOTE\"
    
    Merge Tool: Custom
    Merge Command: C:\Program Files\Beyond Compare 4\BComp.exe
    Arguments: \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"
    Last edited by Chris; 10-Dec-2018, 01:09 PM. Reason: Fixed backslashes that vbulletin removed
    Chris K Scooter Software

    Comment

    • rgomez
      Visitor
      • Dec 2018
      • 6

      #3
      Hello Chris,

      Thanks for the reply.

      This doesn't solve the issue in my case, as the $LOCAL and $REMOTE variables are not being replaced no matter the executable being called. For diff removing all the params seems to work, but with merge it is not possible.

      I saw the mentioned bug, and indeed it's another thing that must be fixed, but it is not this as far as I can see.

      I assume that for most people this doesn't happen, but I can't see anything special or different about my installation.

      Comment

      • Chris
        Team Scooter
        • Oct 2007
        • 5538

        #4
        Sorry, I noticed that vbulletin stripped out backslashes when I originally posted my solution. I edited it so they're now included.

        Does it work correctly if you use the backslashes in the arguments?
        Chris K Scooter Software

        Comment

        • rgomez
          Visitor
          • Dec 2018
          • 6

          #5
          Originally posted by Chris
          Sorry, I noticed that vbulletin stripped out backslashes when I originally posted my solution. I edited it so they're now included.

          Does it work correctly if you use the backslashes in the arguments?
          Hi,

          No, it doesn't matter if it has or not the backsashes. I always end up with something like this:

          "C:\Program Files\Beyond Compare 4\BComp.exe" "$LOCAL" "$REMOTE" "e:\temp\extdiff.ro5ywo\5.0.9a10ca83a9fe\Kernel\VD ataModuleBaseSMartis.cpp" "C:\dev\Sistemas\smartis\5.0\Kernel\VDataModuleBas eSMartis.cpp" /BCompWnd=$00110CE0

          Comment

          • Aaron
            Team Scooter
            • Oct 2007
            • 16007

            #6
            Hello,

            It looks like the tracker entry was recently updated as fixed. If you grab the most recent updates mentioned in the tracker entry linked above, then revert to using the dropdown entry instead of the manual workaround method, has it been fixed for you?
            Aaron P Scooter Software

            Comment

            • rgomez
              Visitor
              • Dec 2018
              • 6

              #7
              Hello Aaron,

              I have the latest version, 3.0.12.2543. As far as I know there is no other released version available. With this version and using either the dropdown option or the custom command it doesn't work. The $VARIABLES are not being replaced.

              This has been going on for several months at least. I have just tried in another computer and the same happens, so it's not something specific to my computer at least, but apparently is not that common as I can't find more posts about this except mine. Most are related to the issue linked, but nothing about the $VARIABLES.

              Thanks!

              Comment

              • Aaron
                Team Scooter
                • Oct 2007
                • 16007

                #8
                Hello,

                I've set up a quick test repository and BC4, and this seems to be working, but we may be executing the diff slightly differently.

                First, I configured the SourceTree Tools menu -> Options dialog, Diffs tab, and selected Beyond Compare from the dropdown. This auto-populated the arguments with:
                "$LOCAL" "$REMOTE"
                and then prompted me to browse to BCompare.exe using a graphical browse dialog. When selected, this then auto-closed the dialog and the Options dialog, but when I re-opened Options' Diff tab to check, it correctly picked BComp.exe (and did not actually pick BCompare.exe).

                In the main SourceTree view, I look at the staged files, could right-click, and execute an External Diff on multiple selected files, launching a new BC4 tab for each. The left side has the path to the temporary version of the older file, while the right is the local change I just made.

                Double checking the path call to BC4 using Process Explorer, it is only passing in paths ("BComp.exe" c:\users\username\appdata\local\temp\tempnamehere. txt myfile.txt). The inclusion of the extra variables looks like a bug or misconfiguration on SourceTree's end. I'd suggest opening a tracker entry with them (which can reference this forum thread, or include [email protected] along with a link to this forum thread for our reference). If there's a bug with the specific method you are using or a typo in the configuration, they may be better equipped to find the answer quickly.
                Aaron P Scooter Software

                Comment

                • rgomez
                  Visitor
                  • Dec 2018
                  • 6

                  #9
                  Hello Aaron,

                  I've already opened a ticket: https://jira.atlassian.com/browse/SRCTREEWIN-11088

                  In my case I haven't find a way for it to NOT include (or replace) the variables.

                  Over there, the merge works ok? I can make diff work, removing the variables in the config, but not the merge, that needs more variables and specific options.

                  Comment

                  • Aaron
                    Team Scooter
                    • Oct 2007
                    • 16007

                    #10
                    Hello,

                    In my configuration, I have the strings above in the Options dialog for both Diff and Merge. External Diff and External Merge commands are able to launch and work.
                    Aaron P Scooter Software

                    Comment

                    • jeroenp
                      Enthusiast
                      • Dec 2013
                      • 39

                      #11
                      Diff still fails, workaround does not work; see https://twitter.com/jpluimers/status...28043216621575

                      Could not try merg yet.

                      Comment

                      • Aaron
                        Team Scooter
                        • Oct 2007
                        • 16007

                        #12
                        Hello,

                        Are you able to append to the "resolved" SourceTree tracker entry? As a SourceTree bug, we aren't going to be able to do much on our end to fix it, but we can provide any resources or answer questions if they ask us. To quickly verify, were you able to re-test against their marked as fixed version: 3.1.1?

                        It's been awhile, but I think I was testing with Git, which would explain the difference in behavior with the updated tracker entry notes that different repositories in SourceTree "incorrectly requires different configuration in SourceTree".

                        I could set up a test machine to reproduce the issue. To confirm, which versions of SourceTree, Mercurial, and BC4 are you running?
                        Aaron P Scooter Software

                        Comment

                        • rgomez
                          Visitor
                          • Dec 2018
                          • 6

                          #13
                          Originally posted by jeroenp
                          Diff still fails, workaround does not work; see https://twitter.com/jpluimers/status...28043216621575

                          Could not try merg yet.
                          Have you tried with the latest version? I'm on SourceTree 3.1.2 and since 3.1 I can use diff and Merge with BC4 without problems.

                          Comment

                          • hapes
                            New User
                            • Jun 2019
                            • 1

                            #14
                            OK, I solved it for me.

                            As per https://community.atlassian.com/t5/S...g/qaq-p/970290

                            Go into C:\Program Files\Git\mingw64\etc
                            edit gitconfig
                            add the following:

                            Code:
                            [difftool "sourcetree"]
                                    cmd = 'C:/Program Files/Beyond Compare 4/bcomp.exe' $LOCAL $REMOTE
                            Haven't tested mergetool yet.
                            Last edited by hapes; 06-Jun-2019, 04:42 PM.

                            Comment

                            • dangoes
                              New User
                              • Jan 2022
                              • 1

                              #15
                              Originally posted by hapes
                              OK, I solved it for me.

                              As per https://community.atlassian.com/t5/S...g/qaq-p/970290

                              Go into C:\Program Files\Git\mingw64\etc
                              edit gitconfig
                              add the following:

                              Code:
                              [difftool "sourcetree"]
                              cmd = 'C:/Program Files/Beyond Compare 4/bcomp.exe' $LOCAL $REMOTE
                              Haven't tested mergetool yet.
                              This worked for me after running into the same problem, thanks!

                              Comment

                              Working...