Skip to content

Git 版本地域2.40时插件的源代码管理无法被正确打开 #440

Description

@prog-ch

提交前确认 / Pre-submit checklist

  • 我已搜索现有 issue,确认没有完全相同的条目(只有完全一致才算重复)| I searched existing issues and confirmed there is no exact duplicate (only exactly identical issues count as duplicates)
  • 我已确认使用最新版本 dsh-better-sidebar / I confirmed I am on the latest dsh-better-sidebar version

运行环境 / Environment

DSH Web(浏览器访问)/ DSH Web (browser access)

DSH Web 版本 + 浏览器 / DSH Web version + Browser

0.1.1-rc.2

Desktop 实现仓库 / Desktop repo(源头 / upstream)

No response

插件版本 / Plugin version

v0.16.1

类别 / Category

🐛 Bug(功能异常 / Something is broken)

描述 / Description

现象:源代码管理无法被正常打开,窗口内显示

error: 未知开关 `z'
用法:git worktree add [<选项>] <路径> [<提交>]
   或:git worktree list [<选项>]
   或:git worktree lock [<选项>] <路径>
   或:git worktree move <工作区> <新路径>
   或:git worktree prune [<选项>]
   或:git worktree remove [<选项>] <工作区>
   或:git worktree unlock <路径>

    --porcelain           机器可读的输出
    -v, --verbose         显示扩展的注释和原因(如果有)
    --expire <到期时间>   向早于 <时间> 的工作区添添加“可修剪”注释

问题根因

dsh-better-sidebar 插件的「源代码管理」(SCM/Git) 面板打开时会执行:

git worktree list --porcelain -z

但 git worktree list 的 -z(NUL 分隔)参数是 git 2.40(2023 年)才加入的。这台机器是 Ubuntu 22.04,系统 git 是 2.34.1,不认这个开关,直接报 error: 未知开关 'z'(实际报的是 git worktree add 的用法帮助),导致面板打开失败。我在临时仓库里精确复现了这条命令在旧 git 上的

补充信息 / Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions