darktable-org / darktable-org/lua-scripts

git commands not running on Windows

未关闭
#671 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Lua
星标
219
派生
142
PR 合并指标
30 天内没有已合并 PR

描述

On windows executing the git command fails from the lua scripts.
It might have something to do with my repo path containing a space. Thought just putting quotes around it does not fix it, there might be strange behaviour in combination with the & concatenator as well.
io.popen("cd " .. repo .. CS .. "git status")
->

fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
     8,8792 LUA ERROR: script_manager.lua: get_current_repo_branch: 318: no current branch detected in repo_data

In my opinion a better solution would be to use the -C <path> argument of git for all commands instead of changing the directory, and also quoting the repo string:
io.popen("git -C \"" .. repo .. "\" status")

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 script_manager.lua 中大约第 318 行的 get_current_repo_branch 开始,跟踪通过 io.popen 调用 git 的 Lua 脚本。在 Windows 上测试包含空格的 repository 路径,并验证 git status 和其他受影响的命令能正确解析 repository,且不会更改目录。

由索引模型根据 Issue 内容生成。

评估

技术栈
git, lua
领域
cli
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
62/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。