Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,949

    Default Using BC4 OSX with Version Control Systems

    Hello and welcome to the BC4 Alpha. We have noticed many of you have begun to incorporate BC4 into your daily work, which includes configuring BC4 for a variety of version control software. We will try to collect and document successful settings here in this forum thread.

    The first step is to launch Beyond Compare, go to the Beyond Compare menu and run "Install Command Line Tools". This will install the necessary bcompare and bcomp scripts needed for many source control solutions.

    Our current Windows and Linux documentation can be found here:
    http://www.scootersoftware.com/support.php?zz=kb_vcs

    If you are using Beyond Compare 4 for Mac as an external diff or merge tool for an application, please feel free to share your configuration in the forum. Once we see the thread, we'll incorporate it into this sticky thread.

    We may not be able to test all of these configurations, so please proceed with caution. BC4 is still an Alpha product and has not been tested with all of the following configurations.
    Aaron P Scooter Software

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,949

    Default

    Git

    Code:
    [diff]
        tool = bcomp
    [difftool]
        prompt = false
    [difftool "bcomp"]
        trustExitCode = true
        cmd = "/usr/local/bin/bcomp" "$LOCAL" "$REMOTE"
    [merge]
        tool = bcomp
    [mergetool]
        prompt = false
    [mergetool "bcomp"]
        trustExitCode = true
        cmd = "/usr/local/bin/bcomp" "$LOCAL" "$REMOTE" "$BASE" "$MERGED"
    Reference: http://www.scootersoftware.com/vbull...ad.php?t=11666
    Aaron P Scooter Software

  3. #3
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,949

    Default

    Cornerstone SVN

    In Cornerstone, you can specify a custom external compare script.

    1) Launch Beyond Compare, go to the Beyond Compare menu and run "Install Command Line Tools"

    DIFF:
    Create an AppleScript wrapper for use by Cornerstone
    Here's the Diff script code:
    Code:
    -- Cornerstone executes the script as:
    --	/path/to/tool <original> <modified>
    --
    on run argv
    	do shell script "/usr/local/bin/bcomp \"" & item 1 of argv & "\" \"" & item 2 of argv & "\""
    end run
    Set in General section of Preferences, External compare tool, Other Script...

    Reference: http://www.scootersoftware.com/vbull...ad.php?t=11689
    Aaron P Scooter Software

  4. #4
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,949

    Default

    Mercurial 2.4.2

    Code:
    [ui]
    merge = bcomp
    
    [extensions]
    extdiff =
    
    [extdiff]
    cmd.bcomp = /usr/local/bin/bcomp
    #opts.bcomp = -ro
    
    [merge-tools]
    bcomp.executable = /usr/local/bin/bcomp
    bcomp.args = $local $other $base $output
    bcomp.priority = 1
    bcomp.premerge = True
    bcomp.gui = True
    Reference: http://www.scootersoftware.com/vbull...ad.php?t=11693
    Aaron P Scooter Software

  5. #5
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,949

    Default

    SourceTree

    Use the Beyond Compare menu -> Install Command Line Tools. Then:

    Code:
    Visual Diff Tool: Other
    Diff Command:/usr/local/bin/bcomp
    Parameters:-ro $LOCAL $REMOTE
    Merge Tool: Other
    Merge Command:/usr/local/bin/bcomp
    Paramters:$LOCAL $REMOTE $BASE $MERGED
    Reference: http://www.scootersoftware.com/vbull...ad.php?t=11695
    Last edited by Aaron; 05-Feb-2014 at 10:34 AM. Reason: Adding -ro for diff
    Aaron P Scooter Software

  6. #6
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,949

    Default

    Syncovery Mac:

    The first step is to launch Beyond Compare, go to the Beyond Compare menu and run "Install Command Line Tools"

    Then to configure Syncovery -

    1. Select menu Syncovery/Preferences...

    2. Click the Misc tab

    3. In the field Program used to compare files from the Sync Preview, write "/usr/local/bin/bcompare" (or the pathname given when using BC4's Install Command Line Tools)

    4. Click Close

    Reference: http://www.scootersoftware.com/vbull...ad.php?t=11673
    Aaron P Scooter Software

  7. #7
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,949

    Default

    IntelliJ IDEA 12: (Potentially also: RubyMine, Webstorm, PyCharm, PhpStorm)

    The first step is to launch Beyond Compare, go to the Beyond Compare menu and run "Install Command Line Tools"

    In IntelliJ's Settings dialog, under IDE Settings, select the External Diff Tools section:

    Compare folders
    Path to executable: /usr/local/bin/bcomp

    Compare files
    Path to executable: /usr/local/bin/bcomp

    Merge tool
    Path to executable: /usr/local/bin/bcomp
    Parameters: %1 %3 %2 %4

    Reference: http://www.scootersoftware.com/vbull...ad.php?t=11824
    Also: http://www.scootersoftware.com/vbull...ad.php?t=12232
    Last edited by Aaron; 09-Aug-2013 at 02:27 PM. Reason: Update: additional, similar programs
    Aaron P Scooter Software

  8. #8
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,949

    Default

    Tower (Git):

    1. Close Tower and BC4

    2. Create the plist file ~/Library/Application Support/Tower/CompareTools.plist

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <array>
    	<dict>
    		<key>ApplicationIdentifier</key>
    		<string>com.ScooterSoftware.BeyondCompare</string>
    		<key>ApplicationName</key>
    		<string>BeyondCompare</string>
    		<key>DisplayName</key>
    		<string>Beyond Compare</string>
    		<key>LaunchScript</key>
    		<string>beyondcompare.sh</string>
    		<key>Identifier</key>
    		<string>BeyondCompare</string>
    		<key>SupportsMergeTool</key>
    		<true/>
    	</dict>
    </array>
    </plist>
    3. Create the shell script file ~/Library/Application Support/Tower/CompareScripts/beyondcompare.sh and chmod +x it

    Code:
    #!/bin/sh
    
    /usr/local/bin/bcomp "$1" "$2" "$3" "$4"
    4. Select Beyond Compare as your merge/diff tool in Tower's preference.


    Reference: http://www.scootersoftware.com/vbull...ad.php?t=12472


    ALTERNATE:
    Code:
    #!/bin/sh
    
    LOCAL="$1"
    REMOTE="$2"
    
    # Sanitize LOCAL path
    if [[ ! "$LOCAL" =~ ^/ ]]; then
    	LOCAL=$(echo "$LOCAL" | sed -e 's/^\.\///')
    	LOCAL="$PWD/$LOCAL"
    fi
    
    # Sanitize REMOTE path
    if [[ ! "$REMOTE" =~ ^/ ]]; then
    	REMOTE=$(echo "$REMOTE" | sed -e 's/^\.\///')
    	REMOTE="$PWD/$REMOTE"
    fi
    
    MERGING="$4"
    BACKUP="/tmp/$(date +"%Y%d%m%H%M%S")"
    
    BCOMP=`which bcomp`
    BCOMPARE=`which bcompare`
    
    if [ ! $BCOMP > /dev/null ] ; then
      if [ -e '/usr/local/bin/bcomp' ] ; then
        BCOMP='/usr/local/bin/bcomp'
      fi
    fi
    
    if [ ! -x "$BCOMP" ]; then    
      echo "Beyond Compares's command line tool 'bcomp' could not be found. Please make sure it has been installed in /usr/local/bin/." >&2
      exit 128
    fi
    
    if [ -n "$MERGING" ]; then
      BASE="$3"
      MERGE="$4"
    
      # Sanitize BASE path
      if [[ ! "$BASE" =~ ^/ ]]; then
        BASE=$(echo "$BASE" | sed -e 's/^\.\///')
        BASE="$PWD/$BASE"
    
        if [ ! -f "$BASE" ]; then
          BASE=/dev/null
        fi
      fi
    
      # Sanitize MERGE path
      if [[ ! "$MERGE" =~ ^/ ]]; then
        MERGE=$(echo "$MERGE" | sed -e 's/^\.\///')
        MERGE="$PWD/$MERGE"
    
        if [ ! -f "$MERGE" ]; then
          # For conflict "Both Added", Git does not pass the merge param correctly in current versions
          MERGE=$(echo "$LOCAL" | sed -e 's/\.LOCAL\.[0-9]*//')
        fi
      fi
    
      sleep 1 # required to create different modification timestamp
      touch "$BACKUP"
      
      "$BCOMP" -ro1 -ro2 -title1="HEAD - $LOCAL" -title2="Merging in - $REMOTE" -title3="Base - $BASE" "$LOCAL" "$REMOTE" "$BASE" "$MERGE"
    else
      MERGE="$3"
    
      if [ -n "$MERGE" ]; then
          #"$BCOMP" -ro1 -ro2 -title1="Remote - $REMOTE" -title2 "Local - $LOCAL" -title3 "Base - $MERGE" "$REMOTE" "$LOCAL" "$MERGE"
          #"$BCOMP" -ro1 -ro2 "$REMOTE" "$LOCAL" "$MERGE"
          "$BCOMP" -vcs1="$MERGE" -ro1 -title1="Local - $LOCAL" -title2="Remote - $MERGE" "$LOCAL" "$REMOTE"
      else
          "$BCOMP" -ro1 -title1="Local - $LOCAL" -title2="Remote - $REMOTE" "$LOCAL" "$REMOTE"
      fi  
    fi
    
    if [ -n "$MERGING" ]; then
      # Check if the merged file has changed
      if [ "$MERGE" -ot "$BACKUP" ]; then
        exit 1
      fi
    fi
    
    exit 0
    Reference: http://www.scootersoftware.com/vbull...ad.php?t=12472
    Last edited by Aaron; 27-Oct-2014 at 09:31 AM. Reason: Update: Reference. CompareToolts.plist -> CompareTools.plist
    Aaron P Scooter Software

  9. #9
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,949

    Default

    Perforce (OSX):

    1) Launch Beyond Compare, go to the Beyond Compare menu and run "Install Command Line Tools"

    2) In the Perforce Preferences dialog, go to the Diff section and select "Other application".
    Set Location to:
    Code:
    /usr/local/bin/bcomp
    and Arguments to:
    Code:
    %1 %2
    Reference: http://www.scootersoftware.com/vbull...ad.php?t=12930
    Aaron P Scooter Software

  10. #10
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,949

    Default

    Subversion (OSX):

    1) Launch Beyond Compare, go to the Beyond Compare menu and run "Install Command Line Tools"

    Diff:

    Create a file named /usr/bin/bcdiff.sh and allow execute permissions (chmod +x). Add the following line:
    /usr/bin/bcomp "$6" "$7" -title1="$3" -title2="$5" -readonly
    exit 0

    Edit "$HOME/.subversion/config" and add the line "diff-cmd = /usr/bin/bcdiff.sh" in [Helpers].

    Merge:

    Create a file named /usr/bin/bcmerge.sh and allow execute permissions (chmod +x). Add the following line:
    /usr/bin/bcomp "$2" "$3" "$1" "$4"

    Edit "$HOME/.subversion/config" and add the line "merge-tool-cmd = /usr/bin/bcmerge.sh" in [Helpers].

    Reference: http://www.scootersoftware.com/vbull...ad.php?t=13168
    Aaron P Scooter Software

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •