与 oneline 相比,带有 tformat 的 git log 中的额外换行符

问题描述

当与其他选项结合使用时,尝试使用 tformat 重现 --oneline 会产生一个额外的换行符,例如:

$ git log --oneline --name-status 
c6104f2 (HEAD -> master,origin/master,origin/HEAD) Remove the Slack chat badge,as nobody uses it anymore
M       README
f77d72b Fix SIGSEGV,Segmentation fault when scanning a now unexistent region.
M       ptrace.c
$ git log --pretty=tformat:"%C(yellow)%h%C(auto)%d %s" --name-status 
c6104f2 (HEAD -> master,as nobody uses it anymore

M       README
f77d72b Fix SIGSEGV,Segmentation fault when scanning a now unexistent region.

M       ptrace.c

没有 --name-status 时不会出现额外的换行符,但它们会出现在我尝试的每个额外选项中。

这一点在this 6 years old question中已经注明,当时的回答是“无能为力”。
我希望在此期间引入一些新选项,或者这会惹恼足够多的人,以至于有知识的人可以将问题带到 git 项目中。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...