Git 标签之间的日志因特定标签而失败
Git log between tags fails with specific tags
我有一个脚本可以为我创建更新日志。在这个脚本中,我使用 git log tag1..tag2。一切都很好,直到我遇到问题
fatal: ambiguous argument 'abc-5.0.0.11..abc-5.0.0.12': unknown revision or path not in the working
tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: ambiguous argument 'abc-5.0.0.10..abc-5.0.0.11': unknown revision or path not in the working
tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
我发现在这些标签之间还有一个:abc-5.0.0.11-4-SNAPSHOT - 我认为这个标签是主要原因。
发生错误的标签列表:
- abc-5.0.0.12
- abc-5.0.0.11-4-快照
- abc-5.0.0.10
脚本搜索:
git log $tag1..$tag2 --pretty=format:"%cd -- %s -- %cn -- %ce" --date=iso --simplify-merges --dense
我怎样才能避免这个问题?
我认为如果您的脚本自己检索完全匹配会更好,但是您可以执行以下操作来自动扩展标签:
git log $(git tag -l | grep -F $tag1)..$(git tag -l | grep -F $tag2) --pretty=format:"%cd -- %s -- %cn -- %ce" --date=iso --simplify-merges --dense
我有一个脚本可以为我创建更新日志。在这个脚本中,我使用 git log tag1..tag2。一切都很好,直到我遇到问题
fatal: ambiguous argument 'abc-5.0.0.11..abc-5.0.0.12': unknown revision or path not in the working
tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal: ambiguous argument 'abc-5.0.0.10..abc-5.0.0.11': unknown revision or path not in the working
tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
我发现在这些标签之间还有一个:abc-5.0.0.11-4-SNAPSHOT - 我认为这个标签是主要原因。
发生错误的标签列表:
- abc-5.0.0.12
- abc-5.0.0.11-4-快照
- abc-5.0.0.10
脚本搜索:
git log $tag1..$tag2 --pretty=format:"%cd -- %s -- %cn -- %ce" --date=iso --simplify-merges --dense
我怎样才能避免这个问题?
我认为如果您的脚本自己检索完全匹配会更好,但是您可以执行以下操作来自动扩展标签:
git log $(git tag -l | grep -F $tag1)..$(git tag -l | grep -F $tag2) --pretty=format:"%cd -- %s -- %cn -- %ce" --date=iso --simplify-merges --dense