How to emulate git log --decorate's different colors per branch-type

萝らか妹 提交于 2019-11-29 19:56:31
kenwarner

Per https://stackoverflow.com/a/16844346/55948

As of git 1.8.3 (May 24, 2013), you can use %C(auto) to decorate %d in the format string of git log.

From the release notes:

 * "git log --format" specifier learned %C(auto) token that tells Git
   to use color when interpolating %d (decoration), %h (short commit
   object name), etc. for terminal output.)
Trebor Rude

I don't believe this is possible. Looking through the git-log(1) man page, the only relevant format for --pretty seems to be %d, which gives you all the ref names. Since there aren't any options which distinguish the type of reference, you can't give each type a different color.

See also this question.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!