Git输出“为路径注册了子模块”与别名config混合

时间:2019-02-20 20:10:38

标签: git git-submodules git-alias git-for-windows

(最初询问on Git mailing liston Git For Windows mailing list,到目前为止没有任何回应。)

问题

在运行git clone --recurse-submodules https://repo命令时,我注意到子模块初始化期间git命令的奇怪输出:

Submodule 'Binary/A' (https://repo) registered for path '!f() { ~/AppData/Local/Fork/Fork.exe $PWD; }; fBinary/A'
Submodule 'Binary/B' (https://repo) registered for path '!sh -c 'git log $1@{1}..$1@{0} $@'Binary/B'
Submodule 'Binary/C' (https://repo) registered for path 'ls-files -o -i --exclude-standardBinary/C'
Submodule 'Binary/D' (https://repo) registered for path 'mergetool.TortoiseGitMerge.trustexitcodeBinary/D'

该命令似乎运行良好并且成功完成。

部分诊断

我设法确定了注入到子模块打印路径中的垃圾是什么。它来自我已经配置的git别名,例如,在~/.gitconfig中包括:

[include]
path = ~/alias_misc.gitconfig

并且在~/alias_misc.gitconfig中有此别名

[alias]
fapp = "!f() { ~/AppData/Local/Fork/Fork.exe $PWD; }; f"

插入到上面复制的Binary/A输出中的git clone路径中。

(所有文件均为available on GitHub)。

问题

有人能解释为什么git在其输出中随机插入别名的定义吗?

我的Git配置文件有什么问题吗?

1 个答案:

答案 0 :(得分:0)

TL; TR:这是Git中的错误,已在2.21中修复。

我已经在Git邮件列表上收到response to my original post

  

当然,我们在即将发布的2.21版本中修复了很多getenv()问题,包括8aac69038f(get_super_prefix():复制getenv()结果,2019-01-11)。

我已验证git版本2.21.0.rc2.windows.1不再出现此问题