使用 vimdiff 展示 svn diff 结果

文章目录

    配置方法

    创建 svn_vimdiff.sh 文件, 代码如下

    #!/bin/sh
    
    # 配置你喜欢的 diff 工具 
    DIFF="/usr/bin/vimdiff"
    
    # Subversion provides the paths we need as the sixth and seventh
    # parameters.
    LEFT=${6}
    RIGHT=${7}
    
    # Call the diff command (change the following line to make sense for
    # your merge program).
    $DIFF $LEFT $RIGHT
    
    # Return an errorcode of 0 if no differences were detected, 1 if some were.
    # Any other errorcode will be treated as fatal.
    

    增加可执行权限,并复制到用户的 bin 目录下

    chmod +x svn_vimdiff.sh
    mv svn_vimdiff.sh ~/bin/
    

    配置 ~/.subversion/config 文件

    [helpers]
    diff-cmd = /home/zhongwei/bin/svn_vimdiff.sh
    

    此时运行 svn diff 就能看到 vimdiff 的展示

    参考

    关于作者 🌱

    我是来自山东烟台的一名开发者,有感兴趣的话题,或者软件开发需求,欢迎加微信 zhongwei 聊聊,或者关注我的个人公众号“大象工具”, 查看更多联系方式