path: root/pretty.c
diff options
authorLars Hjemli <>2009-08-15 14:23:12 (GMT)
committerJunio C Hamano <>2009-08-18 20:14:17 (GMT)
commit33e7018c459e6583b899690cabd21c808ffd3c85 (patch)
tree2249450a0da02f1d7bd9a62f3e8dc2fa012a133b /pretty.c
parent64d5fe0a23e3a16179c7c185662f25d85fe631dd (diff)
git-log: allow --decorate[=short|full]
Commit de435ac0 changed the behavior of --decorate from printing the full ref (e.g., "refs/heads/master") to a shorter, more human-readable version (e.g., just "master"). While this is nice for human readers, external tools using the output from "git log" may prefer the full version. This patch introduces an extension to --decorate to allow the caller to specify either the short or the full versions. Signed-off-by: Lars Hjemli <> Acked-by: Jeff King <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'pretty.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/pretty.c b/pretty.c
index 3b2ecdd..f5983f8 100644
--- a/pretty.c
+++ b/pretty.c
@@ -583,7 +583,7 @@ static void format_decoration(struct strbuf *sb, const struct commit *commit)
struct name_decoration *d;
const char *prefix = " (";
- load_ref_decorations();
+ load_ref_decorations(DECORATE_SHORT_REFS);
d = lookup_decoration(&name_decoration, &commit->object);
while (d) {
strbuf_addstr(sb, prefix);