From: Junio C Hamano Date: Mon, 29 Sep 2014 19:36:08 +0000 (-0700) Subject: Merge branch 'hj/pretty-naked-decoration' X-Git-Tag: v2.2.0-rc0~78 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b8e533f12acec63242c5405286fbbcfa66eecfdd;p=thirdparty%2Fgit.git Merge branch 'hj/pretty-naked-decoration' The pretty-format specifier "%d", which expanded to " (tagname)" for a tagged commit, gained a cousin "%D" that just gives the "tagname" without frills. * hj/pretty-naked-decoration: pretty: add %D format specifier --- b8e533f12acec63242c5405286fbbcfa66eecfdd diff --cc Documentation/pretty-formats.txt index 6c30723740,26904d716f..eecc39dec9 --- a/Documentation/pretty-formats.txt +++ b/Documentation/pretty-formats.txt @@@ -127,9 -126,9 +127,10 @@@ The placeholders are - '%cD': committer date, RFC2822 style - '%cr': committer date, relative - '%ct': committer date, UNIX timestamp -- '%ci': committer date, ISO 8601 format +- '%ci': committer date, ISO 8601-like format +- '%cI': committer date, strict ISO 8601 format - '%d': ref names, like the --decorate option of linkgit:git-log[1] + - '%D': ref names without the " (", ")" wrapping. - '%e': encoding - '%s': subject - '%f': sanitized subject line, suitable for a filename diff --cc log-tree.c index bcee7c5966,f120fd34d1..cff7ac1dbd --- a/log-tree.c +++ b/log-tree.c @@@ -174,24 -179,25 +174,25 @@@ static void show_children(struct rev_in } /* - * The caller makes sure there is no funny color before - * calling. format_decorations makes sure the same after return. + * The caller makes sure there is no funny color before calling. + * format_decorations_extended makes sure the same after return. */ - void format_decorations(struct strbuf *sb, + void format_decorations_extended(struct strbuf *sb, const struct commit *commit, - int use_color) + int use_color, + const char *prefix, + const char *separator, + const char *suffix) { - const char *prefix; - struct name_decoration *decoration; + const struct name_decoration *decoration; const char *color_commit = diff_get_color(use_color, DIFF_COMMIT); const char *color_reset = decorate_get_color(use_color, DECORATION_NONE); - decoration = lookup_decoration(&name_decoration, &commit->object); + decoration = get_name_decoration(&commit->object); if (!decoration) return; - prefix = " ("; while (decoration) { strbuf_addstr(sb, color_commit); strbuf_addstr(sb, prefix);