【AI-提效】svn diff 配置 bcompare

问题 svn diff 配置 bcompare(20251218)

原生svn diff 没有图形化界面不好用,直接配置diff-cmd = /.../bcompare不能使用

解决方案

不废话,直接上代码

bash 复制代码
#!/bin/bash
# SVN参数转BCompare可接受格式的包装脚本(精简版,无冗余echo)

# 初始化文件路径数组
file_paths=()

# 遍历处理参数(从索引1开始,跳过脚本自身)
i=1
while [ $i -le $# ]; do
    current_arg="${!i}"

    # 过滤SVN的-u参数
    if [ "$current_arg" = "-u" ]; then
        i=$((i + 1))
        continue
    fi

    # 过滤SVN的-L参数及对应的标签
    if [ "$current_arg" = "-L" ] && [ $((i+1)) -le $# ]; then
        i=$((i + 2))
        continue
    fi

    # 收集有效文件路径
    if [ -f "$current_arg" ]; then
        file_paths+=("$current_arg")
    fi

    i=$((i + 1))
done

# 调用BCompare(仅保留错误提示)
if [ ${#file_paths[@]} -ge 2 ]; then
    /your_bcompare_path "${file_paths[0]}" "${file_paths[1]}"
else
    echo "❌ 错误:未提取到足够的文件路径(需2个,实际${#file_paths[@]}个),无法执行BCompare"
    exit 1
fi

代码链接:https://github.com/a200638012/myscripts/tree/main/bash/svn_bcompare_wapper

使用方法

  1. modify your svn config in your home dir like ~/.subversion/config
  1. uncomment diff-cmd
  2. diff-cmd = /yourpath_to_svn_bcompare_wrapper.sh
  1. chomd +x /yourpath_to_svn_bcompare_wrapper.sh
  2. now you can use svn diff xxx.file by bcompare
相关推荐
ZzT6 分钟前
cc 写了一周代码,烧了 $2203 Token — 于是我让它给自己做了个账本
ai编程·claude·vibecoding
guoji77881 小时前
2026年AI编程辅助实战:国内镜像站如何使用Claude提升开发效率?
人工智能·ai编程
踩着两条虫2 小时前
AI 驱动的 Vue3 应用开发平台 深入探究(十九):CLI与工具链之Create VTJ CLI 参考
前端·ai编程·vite
孟健2 小时前
设计师慌了:Google Stitch 一出,Figma 两天跌了 12%
ai编程
Dylan~~~2 小时前
AI编程新范式:规范驱动开发SpecKit框架完全指南
驱动开发·ai编程
前端布鲁伊3 小时前
零代码上线一个图片处理网站,我是如何使唤AI干活的?
前端·ai编程
踩着两条虫4 小时前
去“AI味儿”实操手册:从“机器脸”到“高级脸”,只差这三步!
前端·vue.js·ai编程
woshihonghonga4 小时前
解决Eclipse的Copilot终端依赖问题
stm32·mcu·eclipse·copilot·ai编程
会上树的机器人4 小时前
我用 AI Agent 重构了一个嵌入式 C++ SLAM模块——完整工作流复盘与踩坑实录
人工智能·语言模型·ai编程