如何在Git Tower中使用Kaleidoscope 2?

16

本周发布了Kaleidoscope 2公测版,并增加了合并功能。太棒了!然而,关于命令行的使用有些含糊不清。我想与Git Tower一起使用Kaleidoscope,该怎么做呢?

$ 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

Git Tower支持外部合并工具的支持文档

5个回答

13
我的一个遗漏环节是访问:http://www.kaleidoscopeapp.com/ksdiff2并安装Kaleidosope命令行工具(ksdiff)。目前我的“阅读更多”按钮在“Kaleidoscope > integrations..”中未链接,希望这可以帮助其他可能不成功的人。 另一个可能缺失的步骤是在“Tower > Preferences > Integration”中安装Tower命令行实用程序,然后您可以转到“Git Config”选项卡,并选择Kaleidoscope作为您的Diff/Merge工具。

13

8

Git Tower 1.4.14更新说明

Git Tower(版本1.4.14及以上)现已集成Kaleidoscope 2。下面显示的启动脚本不再使用,因为它们与Kaleidoscope 2最终版本不兼容。


当选择Integration > Git merge时,Kaleidoscope会提供正确的命令行用法。Git Tower的正确启动脚本如下:

~/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

这是一个文件路径,对应的是Mac系统中Tower工具的比较配置文件。
<?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>

2
谢谢,Bouke!!!这些脚本将成为我们下一个正式的Tower版本的一部分。如果您想在下次更新之前拥有它们,您也可以在这里下载:http://bit.ly/SMAMyU - Tobidobi
5
这对我没用……但后来我意识到在Kaleidoscope中有一个“集成”菜单选项,第一项安装了Tower所需的命令行工具。 - Mike Gledhill
@MikeGledhill 请阅读 “更新”;Kaleidoscope 2支持已经集成在Git Tower中。 - Bouke
请参考以下网址来了解关于自定义差异工具的相关信息:https://www.git-tower.com/help/mac/integration/custom-diff-tools - MichaelMao

4

我们最新发布的Tower版本(1.4.14版)现已正式支持Kaleidoscope 2作为合并工具。您现在可以从Tower网站下载它。


0
如果您在升级Tower到1.4.14或更高版本之前添加了.sh和.plist的更改,则必须将它们删除,否则Kaleidoscope将无法启动。我手动添加了更改,并且我有Tower版本1.4.15,直到我删除更改之前,Kaleidoscope才能启动。
我还安装了ksdiff工具,使用的是Kaleidoscope 2.0的MAS版本。

是的,我也注意到了当更新到Git Tower 1.4.14时。我已经更新了我的答案以反映这一点。 - Bouke

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接