这与这个问题有关,但我认为它需要一个单独的问题。
git blame --line-porcelain
的输出是这样的
27ce485030bf872158ceb011e6bd775d2ead5eeb 9 36 1
author Joao Tavora
author-time 1358179206
committer Joao Tavora
committer-time 1358179206
summary initial commit
boundary
filename test.el
(defun AB (space task next.task)
242020d0de6363d48d32465299d07239f0a9940f 19 37 1
author Joao Tavora
author-time 1358179709
committer Joao Tavora
committer-time 1358179709
summary reinstate declare
previous 11da1748d905aa9520ee3d6d9ac6a8712db0040f test.el
filename test.el
(declare (ignore space))
cbfa1ec071dd30a27be82dd041ccc9c384e5ff60 11 38 2
author Joao Tavora
author-time 1358179273
committer Joao Tavora
committer-time 1358179273
summary use thingy
previous 69af7ace6e2b6c006c86e4fd91bf3c15ff8cec07 test.el
filename test.el
(if (and (some.task.p (task (IP.TASK-thingy task)))
我将如何使用 sed(或 grep 或 awk)解析来过滤掉提交 sha 和提交时间?在上面的示例中,它应该产生:
27ce485030bf872158ceb011e6bd775d2ead5eeb 1358179206
242020d0de6363d48d32465299d07239f0a9940f 1358179709
cbfa1ec071dd30a27be82dd041ccc9c384e5ff60 1358179273
我宁愿不依赖 ruby,尽管 perl 单线可能没问题。