如何列出所有标签的标签名称、标签日期和标签消息?
似乎git将通过git log
提交的显示逻辑和通过git tag
进行标记的显示逻辑分离,使得很难列出标记名称、标记日期和标记消息。
我可以使用git log --tags --show-notes --simplify-by-decoration --pretty="format:%ai %d %s"
显示标记日期、名称和提交消息
我检查了http://opensource.apple.com/source/Git/Git-26/src/git-htmldocs/pretty-formats.txt,但没有看到任何显示标记消息的选项。
我可以使用git tag -n5
显示标记名称和5行标记消息。
但要获得所有这三条信息,似乎需要编写超出我能力范围的繁琐脚本。
发布于 2014-10-25 22:21:16
您希望使用for-each-ref
命令。不幸的是,它的用户友好性只比filter-branch
稍差一点
请注意,诸如标记日期和标记器之类的信息仅适用于带注释的标记。
下面是一个基本的原型。请注意,format=可以是它自己的整个shell脚本,可能应该根据您希望输出的复杂程度而定。他们有几个专门针对标签in the for-each-ref documentation的例子
git for-each-ref --format="%(refname:short) %(taggerdate) %(subject) %(body)" refs/tags
发布于 2012-09-01 09:15:48
git show --tags
至少会输出你的标签的所有相关信息。您也许能够从那里找到适当的--pretty=format:
序列。
发布于 2018-07-17 13:48:34
一个更好的彩色格式怎么样?
# ~/.gitconfig
[alias]
tags="for-each-ref --sort=taggerdate --format='%(color:green)%(subject)%(color:reset), tagged: %(refname:short)\n%(taggerdate)\n%(taggername) %(taggeremail)\n\n%(contents:body)\n' refs/tags"
$ git tags
Release 1.0.1, tagged: 1.0.1
Wed Jul 4 20:16:05 2018 +0430
Sepehr Lajevardi <sepehr.lajevardi@...>
Changelog
- Implement Contentful webhooks to purge internal and CF caches.
- Implement CloudFlareService.
- Fix Contentful's mapping concern usage/namespace. #73
- Temporarily enforce https in og:url property. #103
- Fix entry callback issue with Contentful client. #99
- Fix issue with PPM docker build. #96
Release 1.1.2, tagged: 1.1.2
Thu Jul 12 21:26:29 2018 +0430
Sepehr Lajevardi <sepehr.lajevardi@...>
Changelog
- Fix GA share event issue with AddThis. #132
- Optimize OpenGraph protocol tags for articles. #130
- Optimize Twitter card tags. #131
- Fix HTML validation errors as much as possible. #127
Release 1.1.3, tagged: 1.1.3
Mon Jul 16 22:49:05 2018 +0430
Sepehr Lajevardi <sepehr.lajevardi@...>
Changelog
- Implement cross-device/browser fav/home icons. #137, #138
- Minify HTML output of all pages. #139
- Check for lighthouse score in build pipeline. #30
- Drop AddThis in favor of in-house ShareBar. #116
- Minor article OG tag adjustments.
https://stackoverflow.com/questions/12219604
复制相似问题