git log 以及提交消息正文中的其他详细信息
我有一个 git 提交模板,如下所示:
[overtype with subject line up to 50 chars ----->]
[overtype with details of what's in the commit]
[other information]
Ticket-Refs:
我想将“Ticket-Refs:”后面的字符串附加到 git 日志图 --pretty=format:
我试图使用 --grep=
要在 %b
或 %B
上实现此目的,我们将不胜感激。
I have a git commit template as below:
[overtype with subject line up to 50 chars ----->]
[overtype with details of what's in the commit]
[other information]
Ticket-Refs:
I would like to append the string after "Ticket-Refs:" to a git log graph --pretty=format:
I was trying to use the --grep=
to achieve this on the %b
or %B
, any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
绝对不是最优雅的方式,但这里有一个选项:
或者另一个选项
我无耻地从 另一篇文章
Definitely not the most graceful way, but here is an option:
Or another option
I shamelessly stole some of the code for the second option from another post
我知道我没有给出确切的答案,但是如果您可以将 Ticket-refs 部分移至 git Notes ,即使用如下所示的方式向提交添加注释:
那么您可以轻松地绘制图表像你想要的那样记录:
否则,我不确定是否可以单独提取该部分,然后将其与图表一起使用。
I know I am not giving an exact answer, but if you can move the ticket-refs part to
git notes
, that is add notes to the commits using something like below:then you can easily do the graph log like you want:
Otherwise, I am not sure if it is possible to extract that part alone and then use it with the graph.