在git submodule status中,所有子模块以以下格式列出:
[ ][commit_sha] [relative path] [description of commit with 'git describe']
例如:
$ git submodule status
f6811d2be995498c162000c27608a0bf4df8d315 submod_1 (tagname-42-gf6811d2)
beda48ff60e29fc31e2a9472041500f39736039d submod_2 (heads/master)我的问题是:如何定制提交的描述?
具体地说,我希望将--exact-match传递给提交的底层git describe,以便在不完全匹配时不使用标记名(如果存在分支名称,则使用分支名!)
发布于 2021-10-20 18:12:14
你可以构建你想要的任何东西,这是一个近乎在线的工具,演示:
git config -f .gitmodules --get-regexp path$ \
| while IFS='. ' read x submodule x path; do
echo $submodule recorded commit is `git rev-parse :$path`
echo $submodule current commit is `git -C $path describe --all --exact @`
donehttps://stackoverflow.com/questions/69650748
复制相似问题