我想以特定格式转换git log --pretty=format:%aN,%ae
。
git log --pretty=format:%aN,%ae
的原始输出:
Yu-Cheng Ling,[email protected]
A. Unique TensorFlower,[email protected]
TensorFlower Gardener,[email protected]
A. Hugo Ronr,[email protected]
...more
所需的转换应如下所示:
Yu-Cheng Ling,[email protected], google
A. Unique TensorFlower,[email protected], tensorflow
TensorFlower Gardener,[email protected], tensorflow
A. Hugo Ronr,[email protected], yahoo
...more
[任何提示或技巧?或更确切地说,您将如何解决问题?
有人可以帮我吗?
谢谢
如果您的数据不包含子域,则可以执行以下操作:
$ git log --pretty=format:%aN,%ae | sed -r 's/@(.+)(\..+)/@\1\2, \1/'
Yu-Cheng Ling,[email protected], google
A. Unique TensorFlower,[email protected], tensorflow
TensorFlower Gardener,[email protected], tensorflow
如果有子域,结果将是:
TensorFlower Gardener,[email protected], blog.tensorflow