git - 命令提交按日期引入“TODO” [英] git – order commits introducing "TODO"s by date

查看:119
本文介绍了git - 命令提交按日期引入“TODO”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想找到引入的提交,添加了TODO或FIXME注释并按日期排序。



我知道 git log -G'TODO | FIXME'将向我显示包含任一注释的提交,并且我可以执行类似于

的操作

  git log --format ='%ci'-G'TODO | FIXME'| cut -d''-f 1 

但是这不会尊重它只应该提交介绍这样的评论。



有谁知道我如何才能找到提交这些评论的提交并按日期排序?如果实际的SHA-1包含在该列表中,那将更加棒。 这应该会让你更接近。目前尚不清楚按日期排列的含义。就个人而言,我可能会忽略实际的日期,并且会颠倒topo顺序。

注意 - 这将匹配引入或移除字符串实例的提交。如果您只想提交引入的提交文件,您可能需要编写脚本。

git log --format ='%H'--reverse - date-order -G'TODO | FIXME'


I want to find commits that introduced added a "TODO" or "FIXME" comment and order them by date.

I know that git log -G'TODO|FIXME' will show me commits that contain either comment and I could do something like

git log --format='%ci' -G'TODO|FIXME' | cut -d' ' -f 1

But this will not respect that it should only be commits introducing such comments.

Does anyone know how I can find only commits introducing such comments and order them by date? If the actual SHA-1 was included in that list, that would be even more awesome.

解决方案

This should get you closer. It isn't clear what you mean by "order them by date". Personally I would probably ignore the actual dates and do reverse topo order.

Note - This will match commits that introduce or remove instances of the string. If you only want commits that introduce you might need to script something.

git log --format='%H' --reverse --date-order -G'TODO|FIXME'

这篇关于git - 命令提交按日期引入“TODO”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆