]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'hj/pretty-naked-decoration'
authorJunio C Hamano <gitster@pobox.com>
Mon, 29 Sep 2014 19:36:08 +0000 (12:36 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 Sep 2014 19:36:09 +0000 (12:36 -0700)
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

1  2 
Documentation/pretty-formats.txt
log-tree.c
pretty.c
t/t4205-log-pretty-formats.sh

index 6c30723740cff5d88d3696f45e2325bc565e5f4a,26904d716f5fdf0e928375116bf038e517dd6d49..eecc39dec99b3cab3da3e36440653ea46ac762b9
@@@ -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 bcee7c596696eb1da109b3ff375e09453045a60f,f120fd34d1f811b6114ab0d1ace7b1ca3fbe2dcf..cff7ac1dbd8942f3013e6fa91d30d2ea33495854
@@@ -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);
diff --cc pretty.c
Simple merge
Simple merge