我正在使用 tup 构建一个项目,并希望将当前提交的 SHA 包含到二进制文件中。问题是 tup 无法识别 .git 目录中的依赖关系,并且 git HEAD 更改时版本文件不会重建。
有问题的 Tupfile 包含:
: |> git rev-parse HEAD > %o |> version-file
问题看起来像这样:
% tup
[...]
[ tup ] [0.068s] Executing Commands...
1) [0.026s] git rev-parse HEAD > version-file
[ ] 100%
% git commit --allow-empty -m "Some commit"
[master b9a0874] Some commit
% tup
[ tup ] [0.000s] Scanning filesystem...
[ tup ] [0.001s] Reading in new environment variables...
[ tup ] [0.001s] No Tupfiles to parse.
[ tup ] [0.001s] No files to delete.
[ tup ] [0.001s] No commands to execute.
[ tup ] [0.001s] Updated.
在 .git 中添加任何文件作为依赖项会导致:
tup error: You specified a path '.git/refs/heads/*' that contains a hidden filename (since it begins with a '.' character). Tup ignores these files - please remove references to it from the Tupfile.
当前 Git 提交更改时如何使 tup 重建版本文件?