简体   繁体   中英

How to use Kaleidoscope 2 with Git Tower?

Kaleidoscope 2 public beta was released this week and has gained merge functionality. Yay! However, the command-line usage is somewhat vague about the usage. I want to use Kaleidoscope together with Git Tower, how can I do that?

$ ksdiff --help
usage: ksdiff - send files to Kaleidoscope
command options:                        
  [--wait, -w | --no-wait]              whether to wait for the document to be
                                        closed in Kaleidoscope before exiting

FILE options:
  [--snapshot | --no-snapshot]          whether the file is temporary. this
                                        option will override the heuristics
                                        ksdiff would otherwise use to determine
                                        this state.

commands:
  --merge                               send a merge
                                        implies --wait
    --output OUTPUT                     use OUTPUT as the destination path for
                                        this merge. creates OUTPUT if it does
                                        not exist.
    [--base BASE]                       use BASE as the base content for this
                                        merge. can improve the quality of the
                                        default selections for some merges.
    FILE FILE                           the files to merge

Support docs for external merge tools from Git Tower

If you're using the MAS version of Kaleidoscope, you must install the ksdiff tool manually in order for Tower to be able to launch Kaleidoscope.

Download it here http://www.kaleidoscopeapp.com/ksdiff2

Update as of Git Tower 1.4.14

Git Tower (version 1.4.14 and above) now ships with Kaleidoscope 2 integration. The launcher scripts shown below should not be used anymore, as they do not work correctly with Kaleidoscope 2 final version.


Kaleidoscope provides the correct command line usage when Integration > Git merge is chosen. The correct launcher script for Git Tower looks like this:

~/Library/Application Support/Tower/CompareScripts/kaleidoscope2.sh

#!/bin/sh

LOCAL="$1"
REMOTE="$2"
BASE="$3"
MERGED="$4"

APPLICATION_PATH=/Applications/Kaleidoscope.app
CMD="$APPLICATION_PATH/Contents/MacOS/ksdiff"

"$CMD" --merge --output "$MERGED" --base "$BASE" -- "$LOCAL" --snapshot "$REMOTE" --snapshot

~/Library/Application Support/Tower/CompareTools.plist

<?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.blackpixel.kaleidoscope</string>
        <key>ApplicationName</key>
        <string>Kaleidoscope</string>
        <key>DisplayName</key>
        <string>Kaleidoscope</string>
        <key>LaunchScript</key>
        <string>kaleidoscope2.sh</string>
        <key>Identifier</key>
        <string>kaleidoscope2</string>
        <key>SupportsMergeTool</key>
        <true/>
    </dict>
</array>
</plist>

The missing link for me was going to: http://www.kaleidoscopeapp.com/ksdiff2 and installing the Kaleidosope command line tools (ksdiff), currently my "Read More" button in "Kaleidoscope > integrations.." is not linked so I hope that helps somebody else who may have been unsuccessful. Another possible missing step is the Tower Command Line Utility installation in "Tower > Preferences > Integration", from there you can go to "Git Config" tab and select Kaleidoscope as your Diff/Merge Tool.

Our latest release (version 1.4.14) of Tower now officially supports Kaleidoscope 2 as a MergeTool. You can now download it from the Tower Website .

If you added the .sh and the changes to the .plist, you must remove them if you upgrade Tower to 1.4.14 or above, or else Kaleidoscope won't launch. I had added the changes manually, and I have Tower version 1.4.15, and Kaleidoscope did not want to launch until I removed the changes.

I also have the MAS version of Kaleidoscope 2.0 and installed the ksdiff tool.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM