Announcement

Collapse
No announcement yet.

SourceTree and BeyondCompare not working for several SourceTree versions.

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?

  • #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


    • #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


      • #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


        • #5
          Originally posted by Chris View Post
          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


          • #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


            • #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


              • #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 support@scootersoftware.com 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


                • #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


                  • #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


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

                      Could not try merg yet.

                      Comment


                      • #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


                        • #13
                          Originally posted by jeroenp View Post
                          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


                          • #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

                            Working...
                            X