X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=pretty.c;h=cc460b56970c3869e67feb816f76f4804e37e7ce;hb=e5f5050ed1481c3bc27658f625a87155aed0984f;hp=421d9c5bca2224777808ccc06fe4912ba8793229;hpb=9b27ea95189b1f276c9f7e10df81fa1476a4ad4d;p=git.git diff --git a/pretty.c b/pretty.c index 421d9c5bc..cc460b569 100644 --- a/pretty.c +++ b/pretty.c @@ -6,6 +6,7 @@ #include "string-list.h" #include "mailmap.h" #include "log-tree.h" +#include "color.h" static char *user_format; @@ -554,6 +555,17 @@ static size_t format_commit_item(struct strbuf *sb, const char *placeholder, /* these are independent of the commit */ switch (placeholder[0]) { case 'C': + if (placeholder[1] == '(') { + const char *end = strchr(placeholder + 2, ')'); + char color[COLOR_MAXLEN]; + if (!end) + return 0; + color_parse_mem(placeholder + 2, + end - (placeholder + 2), + "--pretty format", color); + strbuf_addstr(sb, color); + return end - placeholder + 1; + } if (!prefixcmp(placeholder + 1, "red")) { strbuf_addstr(sb, "\033[31m"); return 4;