From c03fd1bd3a84a1923ef130f20ab0c01ec3d8c742 Mon Sep 17 00:00:00 2001 From: Josef Kufner Date: Sat, 12 Sep 2015 01:25:11 +0200 Subject: pretty: pass graph width to pretty formatting for use in '%>|(N)' Pass graph width to pretty formatting, to make N in '%>|(N)' include columns consumed by graph rendered when --graph option is in use. For example, in the output of git log --all --graph --pretty='format: [%>|(20)%h] %ar%d' this change will make all commit hashes align at 20th column from the edge of the terminal, not from the edge of the graph. Signed-off-by: Josef Kufner Signed-off-by: Junio C Hamano --- log-tree.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'log-tree.c') diff --git a/log-tree.c b/log-tree.c index 7f0890e4ac..a456ed015b 100644 --- a/log-tree.c +++ b/log-tree.c @@ -612,6 +612,8 @@ void show_log(struct rev_info *opt) ctx.output_encoding = get_log_output_encoding(); if (opt->from_ident.mail_begin && opt->from_ident.name_begin) ctx.from_ident = &opt->from_ident; + if (opt->graph) + ctx.graph_width = graph_width(opt->graph); pretty_print_commit(&ctx, commit, &msgbuf); if (opt->add_signoff) -- cgit v1.2.1