Git输出“为路径注册的子模块”与别名配置混合

问题描述 投票:0回答:1

(最初问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配置文件有什么问题吗?

git git-submodules git-alias git-for-windows
1个回答
0
投票

TL; TR:这是Git中的一个错误,修复于2.21。

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

当然我们在即将发布的2.21版本中修复了一堆getenv()问题,包括8aac69038f(get_super_prefix():copy getenv()result,2019-01-11)。

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

© www.soinside.com 2019 - 2024. All rights reserved.